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 » Scripters
Home Search
 

Re: need help

Previous Thread :: Next Thread 
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 02:56 PM
local swordsowner = players[math.random(1,#players)]

now i wanna select a random player and change his walkspeed to 30
so
swordsowner.Character.Humanoid.WalkSpeed = 30
but that doesnt't work.


blank signature
Report Abuse
Wrathoxic is not online. Wrathoxic
Joined: 29 May 2013
Total Posts: 1950
04 Jul 2017 03:08 PM
players=game.Players:GetChildren()

local swordsowner = players[math.random(1,#players)]
repeat wait() until swordsowner and swordsowner.Character and swordsowner.Character.Parent
local char=swordsowner.Character
local hum=char:WaitForChild("Humanoid")
hum.WalkSpeed=30


Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:26 PM
nah man, doesnt work... what the heck


blank signature
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
04 Jul 2017 03:28 PM
What is the error?
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:29 PM
it just literally says nothing in output


blank signature
Report Abuse
Wrathoxic is not online. Wrathoxic
Joined: 29 May 2013
Total Posts: 1950
04 Jul 2017 03:30 PM
I tested my script and it works perfectly fine.


Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
04 Jul 2017 03:32 PM
It's in a server script?

I don't see any problems with Wrath's code either...
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:33 PM
how would i test this? i just put the script into an empty server and nothing happened


blank signature
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:33 PM
oh server script?


blank signature
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:34 PM
still nothing man


blank signature
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:37 PM
am i missing something?
i just copied and pasted the script into an empty world into serverscriptstorage, do i have to do something else? cause nothing is happening

i mean it says
ServerScriptService.Script:3: bad argument #2 to 'random' (interval is empty)


blank signature
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
04 Jul 2017 03:39 PM
Try waiting for a few seconds. The script is probably loading before a player exists.

Or better yet if you are testing with multiple players add something like this to top of the script.

'''Lua
repeat wait() until #game.Players:GetPlayers() >= 2;
'''
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:39 PM
bump


blank signature
Report Abuse
nullfeels is not online. nullfeels
Joined: 31 Mar 2017
Total Posts: 1215
04 Jul 2017 03:40 PM
Okay so this "ServerScriptService.Script:3: bad argument #2 to 'random' (interval is empty)" error will certainly prevent it from working.

You say you copied and pasted it, so paste it back here so we can see exactly your version.
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:40 PM
dude nothing is happening, can you come to my team create please


blank signature
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:40 PM
players= game.Players:GetChildren()

local swordsowner = players[math.random(1,#players)]
repeat wait() until swordsowner and swordsowner.Character and swordsowner.Character.Parent
local char=swordsowner.Character
local hum= char:WaitForChild("Humanoid")
hum.WalkSpeed = 30



blank signature
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:41 PM
players=game.Players:GetChildren()

local swordsowner = players[math.random(1,#players)]
repeat wait() until swordsowner and swordsowner.Character and swordsowner.Character.Parent
local char=swordsowner.Character
local hum=char:WaitForChild("Humanoid")
hum.WalkSpeed=30

i just put that in, still nothing works


blank signature
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:44 PM
please one of you come to my team create, i need help badly


blank signature
Report Abuse
nullfeels is not online. nullfeels
Joined: 31 Mar 2017
Total Posts: 1215
04 Jul 2017 03:45 PM
print the value of #players because the error suggests it's 0. In that case do what EgoMoose said, and then get 2+ people to join your place to test.
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:50 PM
still nothing... where should the script be?
come on man just come to my team create


blank signature
Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:54 PM
please guys!! nothing is working, come to my team create please


blank signature
Report Abuse
Wrathoxic is not online. Wrathoxic
Joined: 29 May 2013
Total Posts: 1950
04 Jul 2017 03:55 PM
I'll come to your team create


Report Abuse
Wrathoxic is not online. Wrathoxic
Joined: 29 May 2013
Total Posts: 1950
04 Jul 2017 03:57 PM
>waits for reply


Report Abuse
Yauig is not online. Yauig
Joined: 12 Jan 2013
Total Posts: 306
04 Jul 2017 03:57 PM
https://www.roblox.com/games/899290943/stupid-scripts-are-broken
friend me


blank signature
Report Abuse
nullfeels is not online. nullfeels
Joined: 31 Mar 2017
Total Posts: 1215
04 Jul 2017 03:59 PM
Sorry, I was AFK...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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