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

Why is my script not acknowledging the contents of my Values folder?

Asked by 3 years ago

Hello, in my game I have a script that I wrote to execute two values. I wrote this:

local player = game.Players.LocalPlayer

script.Parent.Activated:Connect(function() if player.Debounce.Value == false then game.ReplicatedStorage.RemoteEvents.Power:FireServer(script.Parent.Values)

    local action = script.Parent.Parent.Humanoid:LoadAnimation(script.Animation)

    action:Play()
end

end)

And that is what I am using for my simulator, to call on a Folder called "Values" which contains two values, "Cooldown" and "Power" however none of them are working. Clicking on the tool is supposed to add a cooldown value, and a power value, but none of those work, and when I use /console, it doesn't help me much.

0
Check my edited answer Shounak123 461 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

I have edited my answer. Click "View Source" beside the code and copy the code. Then paste it in your script. I think this will work correctly.

local player = game.Players.LocalPlayer

script.Parent.Activated:Connect(function() 
    if player.Debounce.Value == false then 
        game.ReplicatedStorage.RemoteEvents.Power:FireServer(script.Parent.Values)
        local character = player.Character or player.CharacterAdded:Wait()
        local action = character.Humanoid:LoadAnimation(script.Animation)

        action:Play()
    end
end)

And the player.Debounce.Value doesn't seem to make any sense to me. Please explain that further if my given script doesn't work.

0
I have it in a local script, I did notice it looked a little odd when I presented my question, is there any possible error that causes the first 5 lines to not be registered? 700000002 0 — 3y
Ad

Answer this question