Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Question about remote events?

Asked by 5 years ago
Edited 5 years ago

Why is this not working? A lot of the remote events I did a few months ago don't do anything now.

The fire.on the localscript

uis.InputBegan:connect(function(input,process)
if not process and input.KeyCode == Enum.KeyCode.Z then
script.Parent.Event:FireServer()
end
end)

The normal script.

script.Parent.Event.OnServerEvent:Connect(function(player)
print "z"
end)

Nothing happens at all when I press z.

0
Place the script in ServerScriptService, and the local script in StarterPlayerScripts OptimisticSide 199 — 5y
0
I can't put the script in ServerScriptService because the event it is listening for is an individual players ability. Edbotikx 99 — 5y
0
put local uis = game:GetService("UserInputService") Imperialy 149 — 5y
0
also if this is in replicatedstorage.. it wont run Imperialy 149 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Put the remote event in Replicated Storage, put the script in ServerScriptService, and put the local script in starterplayerscripts. Then replace the scripts with these fire.on in local:

uis.InputBegan:connect(function(input,process)
if not process and input.KeyCode == Enum.KeyCode.Z then
game.ReplicatedStorage.Event:FireServer()
end
end)

normal script:

game.ReplicatedStorage.Event..OnServerEvent:Connect(function(player)
print "z"
end)

Accept this answer if it helped you.

0
wrong event..OnServerEvent does nothing Imperialy 149 — 5y
Ad

Answer this question