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

How Do i fix This Error: Expected 'then' when parsing if statement, got ',' ?

Asked by 2 years ago

Script:

click = 0 local plr = game,Players.LocalPlayer while wait()do if click == plr.leaderstats.Crowns,Value then local random = math.random(1,1000) local xnew = Random/1000 local new = game.ReplicatedStorage.ClickingEffect:Clone() new.Parent = script.Parent new.TextBox.Position = UDim2.new(xnew,0,1,0) click = plr.leaderstats.Crowns.Value end end

0
always use "." instead of "," ZIRFAL3 17 — 2y
0
Format your code. PufferfishDev 49 — 2y

2 answers

Log in to vote
0
Answered by 2 years ago
click = 0
local plr = game

while wait() do
    if click == plr.leaderstats.Crowns then
        local random = math.random(1, 1000)
        local xnew = random / 1000
        local new = game.ReplicatedStorage.ClickingEffect:Clone()
        new.Parent = script.Parent
        new.TextBox.Position = UDim2.new(xnew, 0, 1, 0)
        click = plr.leaderstats.Crowns.Value
    end
end

this work yes

Ad
Log in to vote
0
Answered by 2 years ago

You used "," instead of "." so uh ye, here is the fix i guess:



click = 0 local plr = game.Players.LocalPlayer while wait() do if click == plr.leaderstats.Crowns.Value then local random = math.random(1,1000) local xnew = Random/1000 local new = game.ReplicatedStorage.ClickingEffect:Clone() new.Parent = script.Parent new.TextBox.Position = UDim2.new(xnew,0,1,0) click = plr.leaderstats.Crowns.Value end end

Answer this question