Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

im trying to get a sword fighting game running. look in the description for the pieice of code ?

Asked by 3 years ago
Edited by greatneil80 3 years ago

status.value = "there are "..i.." seconds remaning, and "..#plrs.." players are left" is the piece of code. it said that the i in "there are "..i.. can somone please help? the error was w001 unknowned global i.

-- Define variables
 local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerStorage = game:GetService("ServerStorage") local MapsFolder = ServerStorage:WaitForChild("Maps") local Status = ReplicatedStorage:WaitForChild("Status") local GameLength = 60 
-- Game Loop
 while true do Status.Value = "Waiting for enough players" repeat wait(1) until game.Players.NumPlayers > Status.Value = "Intermission" wait(10) local plrs = {} for i, player in pairs(game.Players:GetPlayers()) do if player then table.insert(plrs,player) 
-- Add each player into plrs table
 end end wait(2) local AvailableMaps = MapsFolder:GetChildren() local ChosenMap = AvailableMaps[math.random(1,#AvailableMaps)] Status.Value = ChosenMap.Name.." chosen" local ClonedMap = C Status.Value = ChosenMap.Name.." chosen" local ClonedMap = ChosenMap:Clone() ClonedMap.Parent = workspace 
-- Teleport players to the map 
local SpawnPoints = ClonedMap:FindFirstChild("SpawnPoints") if not SpawnPoints then print("Spawnpoints not found!") end local AvailableSpawnPoints = SpawnPoints:GetChildren() for i, player in pairs(plrs) do if player then character = pl for x, player in pairs(plrs) do if player then character = player.Character if not character then
 -- left the game
 else if character:FindFirstChild("GameTag") then 
-- They are still alive
 print(player.Name.."is still in the game!") else
 -- They are dead 
table.remove(plrs,x) end end else table.remove(plrs,x) print(player.Name.." has been removed!") end end end Status.Value = "There are "..i.." seconds remaning, and "..#plrs.." players are left" if #plrs == 1 then Status.Value = "The winner is "..plrs[1].Name wait(1) end end
0
Can i get the ful code please? MarTieMak 56 — 3y
0
thats all Jace2200 0 — 3y
0
holy crap, there is an edit button for a reason, I'm moving all this code to your question greatneil80 2647 — 3y

Answer this question