I trying to run this through a regular script: while script.Parent:FindFirstChild("Ability").Value == 1 do
print ("909")
wait(1)
end But it doesn't work. I have another script in a local script to test for a key being pressed and once that key is pressed it sets the value of the "Ability" to 1. Here's the code for that: tool.Equipped:Connect(function()
Mouse = game.Players.LocalPlayer:GetMouse()
tool = script.Parent
player = game.Players.LocalPlayer
value = script.Parent.Ability.Value
Mouse.KeyDown:connect(function(key)
if key:lower() == 'q' then
print('Player has used the button A.')
script.Parent.Ability.Value = 1
end
end)
end)

7 comments
Use the UserInputService instead of KeyDown. It's also client-sided.
Alright I'll try thanks
Remote event is what should be used for this
if it is filtering enabled. the local script cant change the value of ability.
The script that detects if ability is 1 only runs once since it is not a loop. It only checked the while once and that one time, it wasnt 1. A connect would be more applicable here though so just use a remote event and connect. Try a remote event that is fired by the client (RemoteEvent:FireServer) and a RemoteEvent.OnServerEvent:Connect(function).
@wwwdanielwww no
Thanks daniel, I'll try that.