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 » Scripters
Home Search
 

Re: Need to turn this into a onPlayerEntered

Previous Thread :: Next Thread 
crazyawsomejames is not online. crazyawsomejames
Joined: 16 Apr 2012
Total Posts: 16167
31 Dec 2015 10:46 PM
I already did some of it:
function onPlayerEntered(player)
game:GetService('Players').PlayerAdded:connect(function(player)
local player = game:GetService('Players')
local playergui = player:WaitForChild('PlayerGui')
if player and playergui then
if playergui:FindFirstChild(sound1.Name) == nil then
sound1.Parent = playergui
sound2.Parent = playergui
end
end
end)
end

but I need to update the local player line
I don't know how to change it
Report Abuse
crazyawsomejames is not online. crazyawsomejames
Joined: 16 Apr 2012
Total Posts: 16167
31 Dec 2015 11:05 PM
also I might be going about this wrong too
if so please tell me :^)
Report Abuse
XIPokezIX is not online. XIPokezIX
Joined: 24 Sep 2015
Total Posts: 381
31 Dec 2015 11:09 PM
game:GetService('Players').PlayerAdded:connect(function(player)
local playergui = player:WaitForChild('PlayerGui')
if player and playergui then
if playergui:FindFirstChild(sound1.Name) == nil then
sound1.Parent = playergui
sound2.Parent = playergui
end
end
end)
Report Abuse
DivinePheonix is not online. DivinePheonix
Joined: 30 Mar 2011
Total Posts: 11190
31 Dec 2015 11:10 PM
Local scripts do not require you to use PlayerAdded, they are automatically added to the Player each time they respawn.
You can use game.Players.LocalPlayer to define the Player quickly by using local scripts.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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