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

Incomplete statement: expected assignment or a function call error?

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

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.

3 comments

0

people keep saying += in their answers. has this been implemented into lua, or are u just being lazy by saying that

0

what's ur problem, or you have no knowledge that exists in lua, called 'compound operators'... stop defaming

0

you can use that in luau which roblox uses, but i'm not sure if that works in lua

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