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: Can't get local player for PlayerGui?

Previous Thread :: Next Thread 
Minecraftrulz94 is not online. Minecraftrulz94
Joined: 22 Feb 2014
Total Posts: 233
16 Nov 2014 12:04 AM
So I made this script:

alert = script.Parent.Parent.Players.LocalPlayer.PlayerGui.AlertTime.Frame
wait(14)

local i = 1
while i < 10 do
alert.BackgroundTransparency = 0.1
wait(0.05)
alert.BackgroundTransparency = 0.2
wait(0.05)
alert.BackgroundTransparency = 0.3
wait(0.5)
alert.BackgroundTransparency = 0.4
wait(0.05)
alert.BackgroundTransparency = 0.5
wait(0.05)
alert.BackgroundTransparency = 0.6
wait(0.05)
alert.BackgroundTransparency = 0.7
wait(0.05)
alert.BackgroundTransparency = 0.8
wait(0.05)
alert.BackgroundTransparency = 0.9
wait(0.05)
alert.BackgroundTransparency = 0.8
wait(0.05)
alert.BackgroundTransparency = 0.7
wait(0.05)
alert.BackgroundTransparency = 0.6
wait(0.05)
alert.BackgroundTransparency = 0.5
wait(0.05)
alert.BackgroundTransparency = 0.4
wait(0.05)
alert.BackgroundTransparency = 0.3
wait(0.05)
alert.BackgroundTransparency = 0.2
wait(0.05)
end

I also tried changing:

alert = script.Parent.Parent.Players.LocalPlayer.PlayerGui.AlertTime.Frame

To

alert = game.Players.LocalPlayer.PlayerGui.AlertTime.Frame

But that did nothing, for some reason I can't access the PlayerGui with this script, can anyone help? I think it might be because it can't find the local player. Thank you.
Report Abuse
WishNite is not online. WishNite
Joined: 11 Feb 2009
Total Posts: 15828
16 Nov 2014 12:18 AM
its a localscript, correct?

put the alert define line underneath the wait(14) and you should be okay.
Report Abuse
Minecraftrulz94 is not online. Minecraftrulz94
Joined: 22 Feb 2014
Total Posts: 233
16 Nov 2014 12:31 AM
Still not working...hmm.
Report Abuse
thermonuklear is not online. thermonuklear
Joined: 19 Oct 2014
Total Posts: 484
16 Nov 2014 01:26 AM
local player = game.Players.LocalPlayer
local alert = player.PlayerGui.AlertTime.Frame

for i = 1, 7, 0.1 do
alert.BackgroundTransparency = i
wait(0.05)
end
for i = 1, 5, -0.1 do
alert.BackgroundTransparency = i
wait(0.05)
end
Report Abuse
MrEpic534 is not online. MrEpic534
Joined: 12 May 2012
Total Posts: 1349
16 Nov 2014 02:07 AM
player = game.players.LocalPlayer
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
16 Nov 2014 04:27 AM
Does it give an error? Btw replace those transparency stuff with 2 loops
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
16 Nov 2014 04:31 AM
Also make sure this is a localscript and if it gets called in the beginning of the game, it could be it isnt yet created
So put the fist line below the wait or add repeat wait() until game.Players.LocalPlayer.PlayerGui:FindFirstChild("alertGui") or something like that :)
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