Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My script checks if the player has left how do i fix it, because it only works in Test mode?

I did this: It detects the signal and transfers it from a Local Script to a Script but the Remove event doesn't do anything... and it only works on Studio Test Mode... Can someone help? Local Script:

function Remove()
print(1)
game:FindFirstChild("ReplicatedStorage").RemoteEvent:FireServer("remove",game.Players.LocalPlayer)

end
--\/     Remove Event
game.Players.PlayerRemoving:Connect(Remove)

Using a Remote Event to transfer the signal

Script

function Check("Word")
print(2)
If Word == "Remove" then
	--Removing scripts
end
game:FindFirstChild("ReplicatedStorage").RemoteEvent.OnServerEvent(Check)

1 comment

0

when i test it with someone else and Purposely leave the game it does nothing.

2 answers

✓ Accepted answer

No need to send remote to detect if player is leaving or joining. PlayerAdded and PlayerRemoving are events that can run on server. Also remote event has player that sent the event as first parameter and word shouldn't have quotation marks so you would need to have:

function Check(player,word)

1 comment

0

Thank you!!!!!!

I think you did a problem that deserve the whole script wasn't work.

The print(1) and print(2) must have quotation marks, you must do print("1") and print("2") instead of print(1) and print(2).

I just think that error occurred the whole script...

Don't wrong this simple problem again, hope I helped and bye! :3

1 comment

0

Sorry for my grammar XD I was hard to explain because I was a child

This discussion is preserved as it was. New answers, comments, and votes are closed.