I'm trying to make a script that opens a player's Gui when they touch a block. When the player touches the block, it fires an event to the client. This works in studio, however it does not in "Play" mode. I get the error "FireClient player argument must be a player object" This is my script
function openGui(player) local user = game.Players:FindFirstChild(player.Parent.Name) open:FireClient(user.Character) end
function closeGui(player) local user = game.Players:FindFirstChild(player.Parent.Name) close:FireClient(user.Character) end
player.Parent (player = body part of the player that touched the block, Parent = the player's character) Nothing seems to fix this :/ I tried making the game search the players list for a player with the same name as player.Parent, but that doesn't fix it either.. Help?

4 comments
thanks for the Info, but I'm still struggling to fire the event to the player touching the block
Nevermind, I've figured it out. Thanks :D
Im seraching around the internet for the same roblem i had when i put Player in the thing its and unknown global help? :)
Nvm i got it