Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a tp script that would still work even when the character respawn/reset?

Asked by 5 years ago

So I've just started to learn the scripting and I'm trying to figure out how to make a script that would work even when the character respawned/reset.

local x = 2810.13721 local y = 14.62482548 local z = -20.818779 game.Players.LocalPlayer.Character:MoveTo(Vector3.new(x, y, z))

This is the script i've been using and once i've respawn/reset. It won't work at all and I have to execute the specific script again for it to work. Anything to work around it? Thanks. :D

0
have u tried a characterAdded? aprilsfooled 29 — 5y
0
Uh.. How should I execute that? Sorry if I'm asking too much. I'm new at this stuffs. ShadowGunzs 0 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
1local x = 2810.13721 local y = 14.62482548 local z = -20.818779
2function sub2(creeper_movie12)
3game.Players.LocalPlayer.Character:MoveTo(Vector3.new(x, y, z))
4end
5 
6sub2()
Ad
Log in to vote
0
Answered by 5 years ago

So basically have a pcall that makes the pad that the player appears on and make it setspawnontouch or something like that, you'll find it in the spawn properties. So ehre's how you do it

01Local pcall = game.ReplicatedStorage.LocalScript
02RenderStepped.TeleportService
03 
04onTouch(hit)
05SetSpawn.New
06 
07local character = player.nil
08local Player = game.Nil.Player.StarterCharacter
09 
10if tweened then
11game.StarterGui.nil.ScreenGui.Image.Size = nil
12and
13game.StarterGui.ScreenGui.Size = (1,0,1,36)
14game.StarterGui.ScreenGui.Position = (0,0,0,-36)
15game.nil.Value.Print("Hello World") -- this will appear in the output to ensure the  script is functioning
16elseif game.ReplicatedStorage.LocalSCript:Clone()
17function(CloneService).net
18 
19wait(9)
20print("You're welcome")

You need the Roblox.StudioDeluxe Package in plugins and set the oc3optical line to lua.net///34 and have it set to the router connected to an IP that is related to the server and client handler using a serverscript in serverscriptservice and use datastores through there.

Answer this question