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: doesnt work

Previous Thread :: Next Thread 
SmoothPlastic is not online. SmoothPlastic
Joined: 16 Dec 2013
Total Posts: 697
14 Jul 2014 09:31 PM
any reason why?



i = Instance.new("Hint",workspace)


function joined()
if game.Players.PlayerAdded then
i.Text = player.Name
wait(3)
i:Remove()
end
end
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
14 Jul 2014 09:34 PM

i = Instance.new("Hint",workspace)
function joined(player)
i.Text = player.Name
wait(3)
i:Remove()
end
game.Players.PlayerAdded:connect(joined)
The parameter in the joined function called "player" is the actual player that joined, game.Players.PlayerAdded:connect(joined) simply connects that event to the function you want it to execute.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
14 Jul 2014 09:37 PM
Alot of reasons. Just keep practicing :)

i = Instance.new("Hint",game.Workspace)


function Joined(player)
i.Text = (player.Name)
wait(3)
i.Destroy()--Remove sets parent to nil, Destroy actually destroys it
end
end

function Joined()--You have to call a function, remember that
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
14 Jul 2014 09:38 PM
No connection line
Won't work the second time since you're deleting the hint

game.Players.PlayerAdded:connect(function(Player)
Hint = Instance.new("Hint",Workspace)
Hint.Text = Player.Name
game:GetService("Debris"):AddItem(Hint,3)
end)
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
14 Jul 2014 09:39 PM
@Connor, You called the function that requires an object as a parameter and it's meant to be used on players. gg no re.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
14 Jul 2014 09:39 PM
OH lol i messed up. I only use game.Players.PlayerAdded:connect(function(player) so
much, that i forgot how to do a regualar loop. Just use anonymous's.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
14 Jul 2014 09:40 PM
Yeah. Stupid mistake. Im known for that.
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
14 Jul 2014 09:41 PM
That's not even how you call a function either.
still gg no re.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
14 Jul 2014 09:43 PM
Here is how i do it.

game.Players.PlayerAdded:connect(function(player)
local h = Instance.new("Hint")
h.Parent = game.Workspace
h.Text = (player.Name)
wait(3)
h.Parent = nil
end)
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
14 Jul 2014 09:45 PM
You should destroy the object if you're never going to use it again.
Use local variables if you're not going to use the debris.
Your hints will get stuck if two players join 3 seconds apart.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
14 Jul 2014 10:08 PM
I didn't know about the "stuck thing", thanks for the info.
~ I mean that sincerely
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