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: Table experimentation gone wrong....

Previous Thread :: Next Thread 
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
29 Feb 2012 10:52 AM
Hi,

Another post by me, another broken script. Why won't this script work? It's pretty much self explanitory to anyone who would have a chance of fixing it....:

------------------------------------------------------------------------------

owner = {"Jezbob"}

function OwnerJoined(name)
for i, v in paris(owner) do
if name == v then
return true
end
end
end

function PlayerAdded(newplayer)
if OwnerJoined(newplayer.Name)then
x = Instance.new("Message")
x.Parent = game.Workspace
x.Text = "The owner of this place has joined the server!"
wait(3)
x:remove()
end
end

-------------------------------------------------------------------------------

Bear in mind I'm new to tables and scripting as a whole.... So why won't this script work?

Thanks alot,
Report Abuse
iguana72 is not online. iguana72
Joined: 21 Feb 2008
Total Posts: 3196
29 Feb 2012 10:55 AM
Are these functions called anywhere?
Report Abuse
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
29 Feb 2012 10:55 AM
Actually, I was following a video on youtube and I thought the very same thing...
Report Abuse
iguana72 is not online. iguana72
Joined: 21 Feb 2008
Total Posts: 3196
29 Feb 2012 11:00 AM
Not sure how these would be called. I haven't used lua for quite a bit. But yeah, I don't see it calling them.
Report Abuse
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
29 Feb 2012 11:03 AM
owner = {"Jezbob"}

function OwnerJoined(name)
for i, v in paris(owner) do
if name == v then
return true
end
end
end

function PlayerAdded(newplayer)
if OwnerJoined(newplayer.Name)then
x = Instance.new("Message")
x.Parent = game.Workspace
x.Text = "The owner of this place has joined the server!"
wait(3)
x:remove()
end
end

game.Players.PlayerAdded:connect(PlayerAdded)

Still doesnt work:/


Report Abuse
iguana72 is not online. iguana72
Joined: 21 Feb 2008
Total Posts: 3196
29 Feb 2012 11:06 AM
Yeah. That should work as far as I know...
Report Abuse
EmoWolf is not online. EmoWolf
Joined: 10 Sep 2008
Total Posts: 115
29 Feb 2012 11:07 AM
--for i, v in paris(owner) do--

I don't use pairs much, but I'm pretty sure Paris has nothing to do with it.
Report Abuse
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
29 Feb 2012 11:09 AM
-_-, *faceplam*, D:, :(
Report Abuse
Jezbob is not online. Jezbob
Joined: 19 Nov 2008
Total Posts: 764
29 Feb 2012 11:15 AM
Still doesn't work:/
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
29 Feb 2012 11:46 AM
Just go with this :P
Inefficient but should work.

function onPlayerEntered(player)
local people = game.Player:GetChildren()
if player.Name = "Jezbob" then
for i = 1,#people do
game:GetService("BadgeService"):AwardBadge(people[i].userId,badgeidhere)
end
end

game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
ultralegomaster5096 is not online. ultralegomaster5096
Joined: 17 Jan 2011
Total Posts: 4351
29 Feb 2012 02:35 PM
You've forgotten a connection line for function OwnerJoined(player). That's the only thing I can see wrong.
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