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
|
  |
| Joined: 21 Feb 2008 |
| Total Posts: 3196 |
|
|
| 29 Feb 2012 10:55 AM |
| Are these functions called anywhere? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 764 |
|
| |
|
Jezbob
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 764 |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|