i am trying to destroy my orb to get steps for my game but when i touch it it doesn't disapear nor give me steps here is the script:
local humanoid = otherPart.Parent:FindFirstChild("Humaniod") --If a character touches the orb then if humanoid then --Finds player from the character part and loads leaderstats local character = otherPart.Parent local player = game.Players:GetPlayerFromCharacter(character) local leaderstats = player:WaitForChild("leaderstats") --Rewards players the points leaderstats.Steps.Value = leaderstats.Steps.Value + script.Parent.StepsBonus.Value --Grabs the colour and step bonus value or the speed orb player.BCVCheck.Value = script.Parent.Shell.BrickColor player.StepsBonusCheck.Value = 0 player.StepsBonusCheck.Value = script.Parent.StepsBonus.Value --Destroys the orb script.Parent:Destroy() end--Ends if statment end--Ends function script.Parent.Shell.Touched:Connect(onOrbContact)
The error is that (in line 1), you wrote "Humaniod"
instead of "Humanoid"
.
Let me know if this was the error.