generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Something wrong...

Previous Thread :: Next Thread 
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
27 May 2012 05:06 AM
function o()
g = game.Workspace.trf:Clone()
g.Parent = game.Players.LocalPlayer.PlayerGui
end

game.Players.ChildAdded:connect(o)


Don't know what is wrong with script.
Report Abuse
legokid135 is not online. legokid135
Joined: 23 Jan 2009
Total Posts: 1470
27 May 2012 05:10 AM
function o()
g = game.Workspace.trf:Clone()
repeat wait() until game.Players.LocalPlayer:FindFirstChild("PlayerGui")
g.Parent = game.Players.LocalPlayer.PlayerGui
end

game.Players.ChildAdded:connect(o)


Sometimes you have to wait for the PlayerGui to load.

~ My RPG is in BETA: http://www.roblox.com/--place?id=80741686 ~
Report Abuse
Aurarus is not online. Aurarus
Joined: 22 Dec 2008
Total Posts: 4761
27 May 2012 05:11 AM
LocalPlayer?
Report Abuse
legokid135 is not online. legokid135
Joined: 23 Jan 2009
Total Posts: 1470
27 May 2012 05:13 AM
@Aurarus, because it's in a LocalScript. You can index the player via LocalPlayer.

~ My RPG is in BETA: http://www.roblox.com/--place?id=80741686 ~
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
27 May 2012 05:28 AM
Still doesnt work...
Report Abuse
legokid135 is not online. legokid135
Joined: 23 Jan 2009
Total Posts: 1470
27 May 2012 05:51 AM
Try this:


game.Players.PlayerAdded:connect(function(nP)
nP.CharacterAdded:wait()
repeat wait() until nP:FindFirstChild("PlayerGui")
Workspace.trf:Clone().Parent = nP.PlayerGui
end)

It should work in a normal script.

~ My RPG is in BETA: http://www.roblox.com/--place?id=80741686 ~
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
27 May 2012 05:59 AM
Now another problem, whats wrong with this:


function group(new)
g = game.Players:findFirstChild(new.Name)
if g then
if g:IsInGroup(527579) then
game.Players.LocalPlayer.PlayerGui.trf.Backround.detectorbackround.det.Text = "Tactical Roblox Forces"
else
game.Players.LocalPlayer.PlayerGui.trf.Backround.detectorbackround.det.Text = "Raider/Visitor/Member"
end
end
end

game.Players.ChildAdded:connect(group)
Report Abuse
legokid135 is not online. legokid135
Joined: 23 Jan 2009
Total Posts: 1470
27 May 2012 06:07 AM
game.Players.PlayerAdded:connect(function(nP)
if nP:IsInGroup(527579) then
repeat wait() until nP:FindFirstChild("PlayerGui")
nP.trf.Background.detectorbackground.det.Text = "Tactical Roblox Forces"
else
nP.trf.Background.detectorbackground.det.Text = "Raider/Visitor/Member"
end
end)

If that still isn't work, you might want to add a wait(3) after the if statement, to let the other script clone the trf into the playergui.

~ My RPG is in BETA: http://www.roblox.com/--place?id=80741686 ~
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
27 May 2012 06:13 AM
Nope, doesnt work
Report Abuse
legokid135 is not online. legokid135
Joined: 23 Jan 2009
Total Posts: 1470
27 May 2012 06:16 AM
game.Players.PlayerAdded:connect(function(nP)
if nP:IsInGroup(527579) then
repeat wait() until nP:FindFirstChild("PlayerGui")
nP.trf.Backround.detectorbackround.det.Text = "Tactical Roblox Forces"
else
nP.trf.Backround.detectorbackround.det.Text = "Raider/Visitor/Member"
end
end)

~ My RPG is in BETA: http://www.roblox.com/--place?id=80741686 ~
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
27 May 2012 06:20 AM
Thats just the same as last time...

And no, it doesnt work.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image