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: Someone help me please : Only help if your a good scripter

Previous Thread :: Next Thread 
kedny23 is not online. kedny23
Joined: 11 Jul 2015
Total Posts: 182
20 Dec 2016 03:19 PM
i need help with this script

local replicatedstorage = game:GetService("ReplicatedStorage")
local status = replicatedstorage:WaitForChild("StatusValue")

while true do
--Intermission
for i = 30,0,-1 do
status.Value = "Intermission: "..i
wait(1)
end
status.Value = "Game has started"
local mapsinserverstorage = game:GetService('ServerStorage'):GetChildren()
local chosemap = mapsinserverstorage[math.random(1, mapsinserverstorage)]
chosemap:Clone().Parent = game.Workspace
status.Value = 'Run from potatoe man!'
wait(2)
local spawns = chosemap:WaitForChild('Spawns') :GetChildren()
for _, player in pairs(game.Players:GetPlayers()) do
if player and #Spawns > 0 then
local torso = player.Character:WaitForChild('Torso')
local allspawns = math.random(1, #Spawns)
local randomspawns = Spawns[allspawns]
if randomspawns and torso then
table.remove(Spawns,allspawns)
torso.CFrame = CFrame.new(randomspawns.Position + Vector3.new(0,2,0))
end

end
end
while true do
wait(10)
local players = game.Players:GetChildren()
print(#players)
if #players >= 1 then
local murderer = players[math.random(1,#players)]
local Potatoe = game.Lighting.Potatoe:Clone()
Potatoe.Parent = murderer.Backpack
end
end
wait(120)
game.Workspace.YoloHouse:Destroy()
wait(9)
status.Value = "finished!"
end
--WHY DOESNT THIS WORK
Report Abuse
eRanged is online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
20 Dec 2016 03:20 PM
Probably because you have 2 "while true do"


Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
20 Dec 2016 03:21 PM
"WHY DOESN'T THIS WORK" is not enough here. We need information.

What happens?
What is SUPPOSED to happen?
What does the output say?

Can't show a horse the water to drink if he is blind folded.
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
20 Dec 2016 03:21 PM
Always tell us any errors the script is sending into output.
Report Abuse
kedny23 is not online. kedny23
Joined: 11 Jul 2015
Total Posts: 182
20 Dec 2016 03:48 PM
the script is suppost to get the map out of server storage teleport all players to the spawsn and then get a random player a potatoe then after 120 sec it will destry the map
Report Abuse
kedny23 is not online. kedny23
Joined: 11 Jul 2015
Total Posts: 182
20 Dec 2016 03:49 PM
Output
16:15:36.366 - ServerScriptService.MainScript:12: bad argument #2 to 'random' (number expected, got table)
Report Abuse
eRanged is online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
20 Dec 2016 03:54 PM
its suppose to be math.random(1, #mapsinserverstorage) you forgot the tag


Report Abuse
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
20 Dec 2016 03:54 PM
Here is the simple finish for others:
#code local replicatedstorage = game:GetService("ReplicatedStorage")
local status = replicatedstorage:WaitForChild("StatusValue")

while true do
--Intermission
for i = 30,0,-1 do
status.Value = "Intermission: "..i
wait(1)
end
status.Value = "Game has started"
local mapsinserverstorage = game:GetService('ServerStorage'):GetChildren()
local chosemap = mapsinserverstorage[math.random(1, mapsinserverstorage)]
chosemap:Clone().Parent = game.Workspace
status.Value = 'Run from potatoe man!'
wait(2)
local spawns = chosemap:WaitForChild('Spawns') :GetChildren()
for _, player in pairs(game.Players:GetPlayers()) do
if player and #Spawns > 0 then
local torso = player.Character:WaitForChild('Torso')
local allspawns = math.random(1, #Spawns)
local randomspawns = Spawns[allspawns]
if randomspawns and torso then
table.remove(Spawns,allspawns)
torso.CFrame = CFrame.new(randomspawns.Position + Vector3.new(0,2,0))
end

end
end
while true do
wait(10)
local players = game.Players:GetChildren()
print(#players)
if #players >= 1 then
local murderer = players[math.random(1,#players)]
local Potatoe = game.Lighting.Potatoe:Clone()
Potatoe.Parent = murderer.Backpack
end
end
wait(120)
game.Workspace.YoloHouse:Destroy()
wait(9)
status.Value = "finished!"
end
--WHY DOESNT THIS WORK



https://www.roblox.com/games/462902053/Project-Maze-Prototype https://forum.roblox.com/Forum/ShowPost.aspx?PostID=204784127
Report Abuse
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
20 Dec 2016 03:55 PM
So to begin:
#code math.random(1, mapsinserverstorage)
will dont work

This, however, will:
#code math.random(1, mapsinserverstorage:GetChildren())


https://www.roblox.com/games/462902053/Project-Maze-Prototype https://forum.roblox.com/Forum/ShowPost.aspx?PostID=204784127
Report Abuse
eRanged is online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
20 Dec 2016 03:56 PM
no its math.random(1, #mapsinserverstorage) because mapsinserverstorage is table so you cant :GetChildren() with it


Report Abuse
kedny23 is not online. kedny23
Joined: 11 Jul 2015
Total Posts: 182
20 Dec 2016 03:58 PM
it doesn't WORK!!!!
Report Abuse
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
20 Dec 2016 04:00 PM
Please don't just spam us with "it doesn't WORK!!!!", actually give us errors from the console, or else we can't help you.


https://www.roblox.com/games/462902053/Project-Maze-Prototype https://forum.roblox.com/Forum/ShowPost.aspx?PostID=204784127
Report Abuse
kedny23 is not online. kedny23
Joined: 11 Jul 2015
Total Posts: 182
20 Dec 2016 04:02 PM
it sais spawns is unknown
also it sais
ServerScriptService.MainScript:4: attempt to index global 'status' (a nil value)
Report Abuse
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
20 Dec 2016 04:04 PM
Maybe moving the value from replicated storage into the script might be a better option.


https://www.roblox.com/games/462902053/Project-Maze-Prototype https://forum.roblox.com/Forum/ShowPost.aspx?PostID=204784127
Report Abuse
kedny23 is not online. kedny23
Joined: 11 Jul 2015
Total Posts: 182
20 Dec 2016 04:28 PM
Ive been tring to script but almost none of them Works

sigh
guess ill play minecraft now
Report Abuse
eRanged is online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
20 Dec 2016 04:41 PM
local status game:GetService("ReplicatedStorage"):WaitForChild("StatusValue")
print('StatusFound starting script...')

while true do
for i = 30,0,-1 do
status.Value = "Intermission: "..i
wait(1)
end
status.Value = "Game has started"
print('Game starting')

local mapsinserverstorage = game:GetService('ServerStorage'):GetChildren()
local chosemap = mapsinserverstorage[math.random(1, #mapsinserverstorage)]
print('MapChosen is: ' .. chosemap.Name)

chosemap:Clone().Parent = game.Workspace
status.Value = 'Run from potatoe man!'
wait(2)

for _, player in pairs(game.Players:GetPlayers()) do
if player and #spawns > 0 then
local spawns = chosemap:WaitForChild('Spawns'):GetChildren()
local torso = player.Character:WaitForChild('Torso')

local randomspawns = spawns[math.random(1, #spawns)]
print(randomspawns.Name .. ' is spawn chosen for ' .. player.Name)

for i,UsableSpawn in pairs(spawns) do
if UsableSpawn.Name == randomspawns.Name then
print('Removed: ' .. UsableSpawn.Name)
UsableSpawn:Destroy() --Destroys since used
end
end
torso.CFrame = CFrame.new(randomspawns.Position + Vector3.new(0,2,0))
end
end
print('Stopped editing right here')

--I didn't edit past here because idek what this is--
while true do
wait(10)
local players = game.Players:GetChildren()
print(#players)
if #players >= 1 then
local murderer = players[math.random(1,#players)]
local Potatoe = game.Lighting.Potatoe:Clone()
Potatoe.Parent = murderer.Backpack
end
end
wait(120)
game.Workspace.YoloHouse:Destroy()
wait(9)
status.Value = "finished!"
end


tell me all prints in output


Report Abuse
kedny23 is not online. kedny23
Joined: 11 Jul 2015
Total Posts: 182
20 Dec 2016 08:52 PM
soso all i need help with is just getting players to teleprt to spawns
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