Still have questions? Join our Discord server and get real time help.
0

Event Fired Clinet Parameter is Nil why???

Edited 16 days ago

I cannot share the full script due to reasons, but I can tell about the following... I have this main script, a regular script in server script service, which picks a random part from the workspace and it fires to a client by.. Event:FireClient(Player, Part.Position). On the receiving end in another script, a local script in starter character scripts, it connects the function as such...

Event.OnClientEvent:Connect(function(Player, Location)
Code Here, Not sharing due to reasons...
end)


My problem is that the Location otherwise Part.Position in this local script is nil why is this a nil value instead of the Vector3 Value???

**My spelling or some Syntax may be wrong, but that is the not issue here.

3
OnClientEvent doesn't have a Player parameter as you can see here. You can get the player from just using game.Players.LocalPlayer since it's a local script. If you try printing 'Player' you'll notice that it will print the Vector3 Value, that's because the part's location is being assigned to 'Player' and 'Location' is going to remain nil because you aren't actually assigning anything to it.