|
| 12 Jun 2014 07:43 PM |
so, ive done this LOTS of times before, and it worked FINE
I decided to add something called "GetODers()" to it which would get some random plrs, and then return them
but the chatted function doesn't even seem to fire(I wrote this from scratch, but im pretty sure I got everything right)
note:NO errors, and its a SB script
plr = game.Players.islandmaker2012
find = function(Str) local Len = #Str local Name = Str print"Finding plr" for i,v in pairs(Workspace:GetChildren()) do for i = Len,1,-1 do if v.Name:lower():sub(1,i) == Name:lower():sub(1,i) then return v end end
end print"not found" return false end function GetOders() print"getting oders" num = game.Players.NumPlayers plrlist = game.Players:GetPlayers() ran = math.random(num/2,num) Used = {} ODers = {} for i=1,ran do chosen = plrlist[math.random(1,num)] if Used[chosen.Name] then repeat chosen = plrlist[math.random(1,num)] until not Used[chosen.Name] end Used[chosen.Name] = true table.insert(ODers,chosen) end
return ODers end function Chat(msg) if msg:lower():sub(1,6) == ":kill " then
if msg:lower():sub(7) == "oders" then tokill = GetODers()
for i,v in pairs(tokill) do ypcall(function() v.Character:BreakJoints() end) end
else tokill = find(msg:sub(7)) if tokill then tokill:BreakJoints() end
end
end
end |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Jun 2014 07:52 PM |
Did you actually return the table from getODers function? Also, why don't you use local variables? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Jun 2014 10:05 PM |
| Your code is a mess, I don't see a connection but do you have one? |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 10:23 PM |
I'm not farmiliar with how your "ODers" code works or if this thread is even serious,
Sorry
|
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 11:55 PM |
@color
Not a troll, just having some fun at SB, it picks random plrs
@cnt I can't believe it, I don't think I connected the chatted event at all..
I'm so used to
plr.Chatted:connect(function(msg) Code end)
That I guess I forgot it?
Sorry q.q |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Jun 2014 12:01 AM |
| plr.Chatted:connect(Chat) in your case |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 12:06 AM |
Usually, I have the code INSIDE the connection line, so when I made the function, somehow I figured I made the connection line..
If that makes any sence
Yeah, ty, that was the prob all along, lol, how embarrasing..... |
|
|
| Report Abuse |
|
|