Okay i've been having this really annoying issue, what i'm trying to do is make a space station with an airlock, when you touch the outer airlock hitbox the server script sends a FireClient event that the player receives, then the client receives it and activates a fly local script, i'm having some issues with the server script, any help?
Error: https://gyazo.com/ce8ed13bfffcc39432abe61429921f3d
Script: https://gyazo.com/dbe6e3b87ed8ec6b276aeee8a0bec802
When you FireClient
, the first argument must be the player you want to fire the event for. You've currently given it player1.Name
, which is a string (which is why it is Unable to cast value to Object
-- it can't turn a string into a player!). You probably want to do :FireClient(player1, player1.Name)
(skip the local player2 = player1.Name
as that variable name is misleading). Don't forget to make sure that player1
exists after assigning to it: if not player1 then return end
(ie only fire the :FireClient line if player1 is not nil).