I have a bool that is passed in through a remote event. It is demonstrated below:
game.ReplicatedStorage.RemoteEvent:FireClient(player, true)
In my local script, I used this code:
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(plr, bool)
local controls = require(player:WaitForChild('PlayerScripts'):WaitForChild('PlayerModule')):GetControls()
if bool == true then
print(bool)
controls:Enable()
return
end
print(bool)
controls:Disable()
end)
Apparently whenever I run this code, the “bool” parameter passed in the remote event is always nil. I don’t know why. Can someone help me?