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

Disabling the Clients Controls?

Sorry I've made like three posts on this, but with every answer to them comes a new problem I am unable to fix.

local disableControlsRE = game:GetService("ReplicatedStorage"):FindFirstChild("DisableControls")

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)

		disableControlsRE:FireClient(player)
		
	end
end)

I've got a ServerScript that fires a RemoteEvent called "DisableControls" when a part is touched, that is the script above, then I've got a LocalScript that triggers when the RemoteEvent is fired, however, the RemoteEvent isn't firing in the above script, can someone help me please?

1 comment

0

Does it error? Have you tried using print statements before and after the line where the remote is fired? Additionally, the touched event might not even be firing in the first place so try printing there.

1 answer

Okay so I fixed it, I must've deleted the "controls:Disable()" on the LocalScript which disables the players control... hence why it wasn't disabling...

Whoops.

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