Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago

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

Log in to vote
1
Answered by 2 years ago
Edited 2 years ago

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

Let me know if this was the error.

0
thx Note_23322 16 — 2y
0
You're welcome! destinid10_2 50 — 2y
Ad

Answer this question