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

Why wont this script add 1 to the value? red underline

Asked by 5 years ago
Edited 5 years ago

As the title says..

local Player = game.Players.LocalPlayer
local DataStore = game.ServerScriptService.DataStore
local Workspace = game.Workspace
local ReplicatedStorage = game.ReplicatedStorage
local ServerStorage = game.ServerStorage
local StarterPlayer = game.StarterPlayer

game.Players.PlayerAdded:Connect(function(plr)
    if Workspace.StarterItemsUpgraded.StarterMonitorUpgraded.ScreenGui.Active == true then
        wait(math.random(10,25))  
        game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value +1
 -- Plus sign is red underline 
        end
    end
end)
0
P.S the +1 is not actually on the next line.. CoreMcNugget 15 — 5y
0
Yes. CoreMcNugget 15 — 5y
0
Does my script work? Lava_Scripter 109 — 5y
0
Still has the red line under the last end)........................ CoreMcNugget 15 — 5y
View all comments (2 more)
0
Ok, Let me try to rewrite it maybe xd. Lava_Scripter 109 — 5y
0
Does that script work? Lava_Scripter 109 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Try That

game.Players.PlayerAdded:Connect(function(Player)
 if Workspace.StarterItemsUpgraded.StarterMonitorUpgraded.ScreenGui.Active == true then
 wait(math.random(15,20))
 plr.leaderstats.Followers.Value = plr.leaderstats.Followers.Value + 1
      end
end)
0
That seems to have no errors, can't test it yet though CoreMcNugget 15 — 5y
0
Ok, I think this should work. Lava_Scripter 109 — 5y
Ad

Answer this question