Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

6 comments

0

P.S the +1 is not actually on the next line..

0

Yes.

0

Does my script work?

0

Still has the red line under the last end)........................

0

Ok, Let me try to rewrite it maybe xd.

0

Does that script work?

1 answer

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)

2 comments

0

That seems to have no errors, can't test it yet though

0

Ok, I think this should work.

This discussion is preserved as it was. New answers, comments, and votes are closed.