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

What is a good way to keep a localscript running after a player leaves?

Hi. I have a localscript inside a surface gui that is activated when a player presses a text button. The script then constructs a tower over a period of time, maybe around 30 seconds. The problem is that when the player leaves the server while the tower is being built, the script stops running and it leaves the tower that is being constructed in the middle of its construction phase.

Can anybody give me advice on how to stop this problem? Note: The script doesn't have to be a localscript, but it's more convenient if it is.

1 answer

✓ Accepted answer

You could fire a RemoteEvent that is located on the server.

local Event = ????

script.Parent.MouseButton1Down:connect(function()
	Event:FireServer(Arg1,Arg2)
end)

Server Script:

local Event  = ????

function Event.OnServerEvent(Player,Arg1,Arg2)
	--Stuff
end

2 comments

0

Ok thanks!

0

Long time no see.

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