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

How do I move a script from one service to another service by using a script?

Asked by 5 years ago

I have a script in the service Workspace. I want it to go to the service StarterGui after 5 seconds. I have made a script. I waited more than 5 seconds. To make sure, I used a 30 second timer, once I joined the game. I looked at my explorer. The script was still in the service Workspace. To make sure it was the right script, I looked in it and it still had the same code. Also, I looked in StarterGui and saw no script. So, the script that was "supposed" to move the script to the service StarterGui did not work.

Here is the code in the script that was "supposed to move the script to the service StarterGui:

wait(5)
game.Workspace.Camera.Parent = game.StarterGui --Camera is the script.

Please explain to me what I should do to fix this, or give me the code to fix this. Thank you.

1 answer

Log in to vote
0
Answered by
174gb 290 Moderation Voter
5 years ago
Edited 3 years ago

If you want to change to the guide that the player already has

you have to use this

--Change the camera name first

--Change the camera name first

game.Players.PlayerAdded:connect(function(plr)

local camera = game.Workspace.Camera2:Clone()

if plr.PlayerGui then
      camera.Parent = plr.PlayerGui
   end
end)

Now, go to players > you > PlayerGui and check if camera is on

0
Camera is not in PlayerGui. AwesomeMrBird -79 — 5y
0
Change the camera Name 174gb 290 — 5y
0
Thanks! AwesomeMrBird -79 — 5y
Ad

Answer this question