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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 12 Jan 2013 |
| Total Posts: 306 |
|
|
| 04 Jul 2017 03:33 PM |
oh server script?
blank signature |
|
|
| Report Abuse |
|
|
Yauig
|
  |
| Joined: 12 Jan 2013 |
| Total Posts: 306 |
|
|
| 04 Jul 2017 03:34 PM |
still nothing man
blank signature |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 12 Jan 2013 |
| Total Posts: 306 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 29 May 2013 |
| Total Posts: 1950 |
|
|
| 04 Jul 2017 03:55 PM |
I'll come to your team create
|
|
|
| Report Abuse |
|
|
Wrathoxic
|
  |
| Joined: 29 May 2013 |
| Total Posts: 1950 |
|
| |
|
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
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
| |
|