|
| 15 Dec 2015 06:23 PM |
Why this script doesn't work on "Play game"? :
function onClicked() wait(0.1) script.Intro:Clone().Parent = game.Players.Player.PlayerGui end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
this works in solo mode. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2015 06:25 PM |
The test player in Solo Mode is named Player, so you're telling it to clone script.Intro and put it in here:
game -- Players ---- Player ------ PlayerGui
When you try to do it in "Play Game" (this is called Online mode) that doesn't exist. Instead this does:
game -- Players ---- ClickNoPenguinX2 |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Dec 2015 07:14 PM |
for _, player in pairs (game.Players:GetChildren()) do --code end |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2015 07:16 PM |
That's 100% possible. The MouseClick event of a click detector actually gives you the player that clicked it as a parameter. You can get it in your script like this:
function onClicked(player) -- player = whoever clicked it wait(0.1) script.Intro:Clone().Parent = player.PlayerGui -- whoever clicked it gets it end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
| |
|
| |
|