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

Scripting error, What do I do?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
local playerStats = {} --this keeps a list of the stats for each player that enters the game

 game.Players.PlayerAdded:connect(function(player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "leaderstats"

     local grouprank = Instance.new("StringValue", leaderstats)
     grouprank.Name = "Rank"
     local rank = player:GetRoleInGroup(1070236) -- Insert the group ID for whatever group you want ranks displayed for here. 

     if rank ~= 0 then
         grouprank.Value = rank
     else
         grouprank.Value = "Join U.F.P."
     end

     playerStats[player] = leaderstats 
 end)


local playerstats = {}
game.Players.PlayerAdded:connect (function (player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "Allies"
end


local playerstats = {}

 game.Players.PlayerAdded:connect(function(player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "Enemy"
end

But my question is... It says ')' expected (to close '('at line 22) near 'local' But when I do it line 22 gets underlined red and it says '(' expected near ')' What do I do?

1 answer

Log in to vote
3
Answered by 10 years ago
local playerStats = {} --this keeps a list of the stats for each player that enters the game

 game.Players.PlayerAdded:connect(function(player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "leaderstats"

     local grouprank = Instance.new("StringValue", leaderstats)
     grouprank.Name = "Rank"
     local rank = player:GetRoleInGroup(1070236) -- Insert the group ID for whatever group you want ranks displayed for here. 

     if rank ~= 0 then
         grouprank.Value = rank
     else
         grouprank.Value = "Join U.F.P."
     end

     playerStats[player] = leaderstats 
 end)


local playerstats = {}
game.Players.PlayerAdded:connect (function (player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "Allies"
end) --you forgot to close this one


local playerstats = {}

 game.Players.PlayerAdded:connect(function(player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "Enemy"
end) -- and also this one
0
Thanks! iiCasual 20 — 10y
1
nps c; TochiWasHere 10 — 10y
Ad

Answer this question