Hi there! Im trying to make a blocking function for my fighting game, most of the code is going to be handled in the weapon that deals damage but all i need right now is this to work. When i press Q the “Blocking” bool value in the player does not change, nor does anything go to the output. (I am sorry in advance for any sins i have committed with this script)
Code:
function onKeyPress(inputObject, gameProcessedEvent)
if (not gameProcessedEvent and inputObject.KeyCode == Enum.KeyCode.Q) then
humanoid.Parent.Blocking.Value = true
print(humanoid.Parent.Blocking.Value)
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
This looks like a LocalScript. Any changes you make to instances via the client cannot be accessed/viewed from the server. Given there’s no errors, it works, but you’ll have to send a signal through a RemoteEvent and then change the blocking value on a server script.
It is being changed on a server script, as everything in the tool currently is handled on the server
When i changed the value in startergui, i used a local script and it worked?
Okay, nevermind. What i’ve done now is have a local script that listens for it, fires a remote event in the tool and then the server script listens to that remote event and fires the function, i think UIS only works on client (unless i did something wrong)