Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

can i fix this destroy script and is this script even the error?

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)

1 answer

✓ Accepted answer

The error is that (in line 1), you wrote "Humaniod" instead of "Humanoid".

Let me know if this was the error.

2 comments

0

thx

0

You're welcome!

This discussion is preserved as it was. New answers, comments, and votes are closed.