|
| 06 Dec 2014 09:38 AM |
WHY DOESNT THIS WORK (i tryed to do this in 3 player studio, but it didnt work...
local roundtimer = 60 * 5 local intermissiontime = 20 local serverstorage = game:GetService("ServerStorage") local replicatedstorage = game:GetService("ReplicatedStorage") local debris = game:GetService("Debris") local event = replicatedstorage:WaitForChild("RemoteEvent") local maps = serverstorage:WaitForChild("Maps") local mapholder = game.Workspace:WaitForChild("MapHolder")
while true do mapholder:ClearAllChildren() wait(2) local allmaps = maps:GetChildren() newmap = allmaps[math.random(1, #allmaps)] newmap.Parent = game.Workspace wait(2) while true do wait(5) contestants = {} for _, player in pairs(game.Players:GetPlayers()) do if player and player.Character then local humanoid = player.Character:WaitForChild("Humanoid") if humanoid and humanoid.Health > 0 then table.insert(contestants, player) end end end end if #contestants >= 3 then else end bloxxer = contestants[math.random(1, #contestants)] while true do randomplayer = contestants[math.random(1, #contestants)] if randomplayer ~= bloxxer then sherrif = randomplayer break end end end local spawnsmodel = newmap:WaitForChild("Spawns") local spawns = spawnsmodel:GetChildren() for _, player in pairs(contestants) do if player and player.Character and #spawns > 0 then local torso = player.Character:WaitForChild("Torso") local spawnindex = math.random(1, #spawns) local spawn = spawns[spawnindex] if spawn and torso then table.remove(spawns, spawnindex) torso.CFrame = CFrame.new(spawn.Position + Vector3.new(0, 3, 0)) local backpack = player:FindFirstChild("Backpack") if backpack then if player == bloxxer then local sword = serverstorage:WaitForChild("Sword"):clone() sword.Parent = backpack elseif player == sherrif then local netgun = serverstorage:WaitForChild("Revolver"):clone() netgun.Parent = backpack end end end end end spawnsmodel:Remove()
halp me if u cri evertim |
|
|
| Report Abuse |
|
|
| |
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 06 Dec 2014 09:40 AM |
| Please tell us what's wrong, what you are trying to accomplish, and any errors. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2014 09:43 AM |
The output says this 04:42:27.224 - Unable to create an Instance of type "StockSound" and 04:42:23.594 - Plugin_142731176._Char:365: attempt to index global 'character' (a nil value) But it always says unable to create an instance of stocksound, think its a bug with my studio. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2014 09:53 AM |
| Well, im really, really sad now. Nobody is gonna help me fix it, and i wasted about 3 days making a script that didnt even work. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2014 10:00 AM |
Alright, if you are making a server script (and judging off your Subject for this forum post), I can tell you're thinking to hard. Take a few deep breaths, then disable this script and try again. Envision in your head the full script properly functioning and think to yourself "What do I see happening now?" then write the code you need to make that happen. Example: So let's do this, we need it to repeat so... while wait() do Next, let's start the script with an intermission (I know that this is not an actual script because I don't feel like writing a server script) intermission() Now I see the intermission being 15 seconds, let's make it happen. wait(15) Now, we need the map selected... maps = game.ReplicatedStorage.MapsModel:GetChildren() mapnumber = math.random(1,#maps) map = game.ReplicatedStorage.MapsModel:FindFirstChild("Map" .. mapnumber):Clone() map.Parent = workspace Now I am seeing the players' teams being randomized AutobalancePlayers() Okay, now I see them being teleported to their map spawn locations TeleportPlayers() Alrighty, now I'm seeing a 5 second pre-game intermission wait(5) Now, they are gonna need their guns GivePlayersGuns() Alright, wait out the time for the game to happen wait(300) -- Five minute game (Want an easy way to convert minutes into seconds for a wait time? Easy just minutes times seconds. Ex. wait(5*60)) Okay, check the score and see who won CheckScoreAndAnnounceWinner() Alright, now we need to end the game ResetPlayersTeamsAndPutThemInTheLobby() The map needs to be deleted... map:Destroy() And we need to end the while wait() do line, so... end |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2014 10:01 AM |
| Whoops, didn't mean to say "Server Script", I meant like the Main Game Script that handles everything. You know what I meant probably though, just wanted to clarify. |
|
|
| Report Abuse |
|
|