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

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

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.

1 comment

0

Check my edited answer

1 answer

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.

1 comment

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?

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