ServerScriptService.ServerStaminaScript:7: Expected identifier when parsing expression, got '.'

I am having an error on somthing i think is basic.
The error is in the title.

My script is:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
local RemoteEvent = RemoteEvents:WaitForChild("Stamina")

local function StaminaMod(Player,NewStamina)
	local Stamina = Player.PlayerGui.StaminaGui.Stamina
	local Stamina.Value = Stamina.Value + NewStamina --The error is here
	print("Stamina changed to "..Stamina.Value)
end

RemoteEvent.OnServerEvent:Connect(StaminaMod)

I really need help so thank you

Remove local :slight_smile:
local Stamina.Value =

2 Likes

just remove the local and add “+=”

Stamina.Value += NewStamina

1 Like

local is for variables so the script is confused why there is a dot

1 Like

i am so stupid :man_facepalming:

Thank you so much !!