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: im confused, like, extremely

Previous Thread :: Next Thread 
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
12 Jun 2014 07:49 PM
hopeful bump?
Report Abuse
cntkillme is not online. 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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
12 Jun 2014 07:59 PM
yes, I did

return ODers
end
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
12 Jun 2014 08:05 PM
BUMP
Report Abuse
cntkillme is not online. 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
ColorfulBrendon is not online. ColorfulBrendon
Joined: 28 Jul 2010
Total Posts: 23556
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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2014 12:01 AM
plr.Chatted:connect(Chat) in your case
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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
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