Ok so I have a local script in a gui that when clicked it fires an event along with the data char which is the character of the player and is meant to be picked up by a script in serverscriptservice. HOWEVER while the local script fires the event and I know that it does because it prints out a confirmation the server doesnt pick up the event and doesnt do its part.
This is the local script:
local player = game.Players.LocalPlayer local char = player.Character function OnClicked() print "Clicked" game.ReplicatedStorage.JoinedMap:FireServer(char) print "EventSent" end script.Parent.MouseButton1Down:connect(OnClicked)
And this is the server script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("JoinedMap")
local function JoinedMap(char) print "Event Recieved" char.Parent = game.Workspace.PlayersMap print "Set Parent" remoteEvent.OnServerEvent:Connect(JoinedMap) end
Im so confused why isnt it getting picked up? It prints out "Clicked" and it prints out "EventSent "but the server does NOT print out "Event Received" nor does it print out "Set Parent"
Try moving remoteEvent.OnServerEvent:Connect(JoinedMap)
underneath end.
So:
local function JoinedMap(char) print "Event Recieved" char.Parent = game.Workspace.PlayersMap print "Set Parent" end remoteEvent.OnServerEvent:Connect(JoinedMap)