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

Expected identifier when parsing expression, got then?

Asked by 3 years ago

I got this error and I don't know what I did wrong. I searched the error up online and got no results. I've also tried removing ends and adding ends. I need help, thanks.

local ReplicatedStorage = game:GetService('ReplicatedStorage')

local remoteEvent = ReplicatedStorage:WaitForChild('ShowPlayer')

local players = game.Players.Stage



textColor = BrickColor.new('Lime green')

if players.Value = 40 then
    local function complete(playerName, partName)

        game.StarterGui:SetCore('ChatMakeSystemMessage', {

            Text = playerName..' completed '..partName;

            Font = Enum.Font.SourceSansBold;

            Color = textColor.Color;

            FontSize = Enum.FontSize.Size24;

        })

    end

    remoteEvent.OnClientEvent:Connect(complete)
end

1 answer

Log in to vote
0
Answered by 3 years ago

The error is due to line 11, checking for equivalency is ==, assigning a value is =. I fixed your script but fairly certain this still wont work due to line 5, do you have a player named Stage? If this is a localscript get the LocalPlayer.

local ReplicatedStorage = game:GetService('ReplicatedStorage')

local remoteEvent = ReplicatedStorage:WaitForChild('ShowPlayer')

local players = game.Players.Stage

local function complete(playerName, partName)

    game.StarterGui:SetCore('ChatMakeSystemMessage', {

    Text = playerName..' completed '..partName;

    Font = Enum.Font.SourceSansBold;

    Color = textColor.Color;

    FontSize = Enum.FontSize.Size24;

    })

end

textColor = BrickColor.new('Lime green')

if players.Value == 40 then
    remoteEvent.OnClientEvent:Connect(complete)
end

0
i made a mistake in line 5 its supposed to be NotANinja_9210 7 — 3y
0
local players = game.Players.leaderstats.Stage NotANinja_9210 7 — 3y
Ad

Answer this question