-
What do you want to achieve? I want to achieve script printing “server test” with remote event that’s being fired from a local script that prints “client test”.
-
What is the issue? “server test” is not being printed, despite the FireServer i put in localscript.
-
What solutions have you tried so far? As usual, I’ve looked for solutions in DevForum and Developer Hub, but it didn’t work. I also tried adding :WaitForChild(), but that didn’t work too.
Server script:
local remote = script.Parent:WaitForChild("thing")
remote.OnServerEvent:Connect(function(plr,action)
if action == "test" then
print("server test")
end
end)
Local script:
local uis = game:GetService("UserInputService")
local sus = script.Parent:WaitForChild("thing")
uis.InputBegan:Connect(function(input,ae)
if ae then
return
end
if input.KeyCode == Enum.KeyCode.E then
print("client test")
sus:FireServer("test")
end
end)
Output:
client test - Client - client:9
Would appreciate the help!