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

How would I make this play when the player respawns?



script.Parent.Parent.Enabled = true

local text = ">LOCATION [REDACTED]"
		for i = 1, #text do
	script.Parent.Text = string.sub(text, 1, i)
	script.Parent.Click:Play()
	
script.Parent.Parent.Enabled = false

Here is the script so far .

1 comment

0

What is script.Parent.Parent? What is script.Parent.Click? Is it a localscript or a server script? Where is it located?

2 answers

Since i don't have all the code, I can just give you an answer, you could add a string that will wait for the character to die and then it would happen. Don't accept my answer if it doesn't help

1 comment

0

This is the full script


Explanation

What you would have to do is when the Character is added, you have it do whatever it is you want it to do.


Error in the Code

For one, you don't have to have the script disable for something like this. All you need is for it to run off of when the character is placed again. You forgot an end for your for do code.


The Code

Player.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(character)
		local text = ">LOCATION [REDACTED]"
      		for i = 1, #text do
  			script.Parent.Text = string.sub(text, 1, i)
 			script.Parent.Click:Play()
		end --You forgot this end in your original code
	end)
end)

3 comments

0

I will note that this may not work as I don't exactly know what you're trying to do, however this should do whatever it is you want it to do when the person resets and their character is added to the game again.

0

I appreciate the help, but I forgot to state that this script is a local script

0

Okay, I would still try this script and see if it does as you please.

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