Hunt down the nil characters, the silent tweens, and the sounds nobody hears.
The world's bugs are mostly about timing and who runs what: grabbing a character before it spawns, building a and never playing it, and playing sounds on the wrong computer. Three smells, five hunts.
A joins and your instantly errors on player.Character.Humanoid — nil.
Players.PlayerAdded:Connect(function(player)
local humanoid = player.Character.Humanoid
end)
Why is player.Character nil at join time?
Even inside CharacterAdded, the character's load over a few frames. Make the grab safe so it can't error on an unloaded .
local humanoid = character.Humanoid
Write the line that grabs the Humanoid safely.
You built the perfectly — TweenInfo, goals, Create — and the sits there. No error, no motion.
local info = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local goals = { CFrame = coin.CFrame + Vector3.new(0, 5, 0) }
local tween = TweenService:Create(coin, info, goals)
Write the missing line that starts the tween.
You click the coin, the coins go up, but there's no sound — on anyone's computer.
-- Script (server)
coin.ClickDetector.MouseClick:Connect(function(player)
coin.Sound:Play()
clickEvent:FireServer()
end)
The pickup sound plays nowhere. What's the likely cause?
You want the pickup sound to play for the clicking , right before the reward is reported. Write the line that plays it.
coin.ClickDetector.MouseClick:Connect(function()
-- play the pickup sound here
clickEvent:FireServer()
end)
Write the line that plays the coin's sound on the client.
Assemble a coin pickup: a touch, a character, a , a reward.