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

How do I delete script permanently using script?

Asked by 5 years ago

So, I am trying to make a tutorial for my game, but I don't know how I would make the script play once only or gets perm deleted. Is there anyway I can do that?

0
script.Disabled or script:Destroy() Vulkarin 581 — 5y
0
Within the script itself? You can destroy it with script:Destroy() or simply disable it with script.Disabled = true saenae 318 — 5y
0
Ah, Vulkarin beat me to it :P saenae 318 — 5y
0
But then when he rejoins wouldnt it reset? mixgingengerina10 223 — 5y
View all comments (3 more)
0
No, only when the server restarts(or open) Leamir 3138 — 5y
0
Well, granted that it's a localscript you're referring to, yeah, it would re-replicate every time you join. If you want a tutorial to fire off once per client, regardless of whether they rejoin, you're going to want to use a datastore that tracks completion. saenae 318 — 5y
0
Oh rip mixgingengerina10 223 — 5y

2 answers

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

I looked over the comments and noticed that you want it to save after the player leaves.

You should probably set up a Boolean Value in the player called "TutorialCompleted" which saves. Once a player joins it should check over the value and see what it's set to.

(If false, play tutorial, if true, skip tutorial)

Ad
Log in to vote
0
Answered by 5 years ago
script.Remove(script) -- only comes back when the player rejoins the game

Answer this question