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

Incomplete statement: expected assignment or a function call error?

Asked by 3 years ago
Edited by Gey4Jesus69 3 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).
local Taps = game.Players.LocalPlayer.leaderstats.Taps.Value + 1
local cd = false
script.Parent.MouseButton1Click:Connect(function()
    if cd == false then
        cd = true
        Taps + 1
    script.Parent.Sound:Play()
    script.Parent.Active = false
    wait(.05)
    script.Parent.Active = true
    cd = false
    end
end)

1 answer

Log in to vote
0
Answered by 3 years ago

Firstly, Taps is defined as the current leaderstats.Taps.Value in client + 1. Secondly, you did Taps + 1 instead of Taps += 1 or Taps = Taps + 1. Thirdly, change the value in the server instead of the client. Use remote events and server scripts to make the change visible to the server and to prevent complications.

0
people keep saying `+=` in their answers. has this been implemented into lua, or are u just being lazy by saying that Gey4Jesus69 2705 — 3y
0
what's ur problem, or you have no knowledge that exists in lua, called 'compound operators'... stop defaming Gabe_elvin1226aclan 323 — 3y
0
you can use that in luau which roblox uses, but i'm not sure if that works in lua krowten024nabrU 463 — 3y
Ad

Answer this question