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

How do i fix expected then error?

local part = script.Parent
local player = game.Players
local PlrStats = player:FindFirstChild("PlrStats")
	local currentStand = PlrStats:FindFirstChild("Stand")
	
local click = part.ClickDetector
if currentStand.Value = "Stand1" then
	local function go(player)

		player.Character.HumanoidRootPart.CFrame = CFrame.new(part.Position + Vector3.new(0,3,0))

	end
end)

Error: (7,23) Syntax error: Expected 'then' when parsing if statement, got '=' Line 7

1 answer

✓ Accepted answer
local part = script.Parent
local player = game.Players
local PlrStats = player:FindFirstChild("PlrStats")
    local currentStand = PlrStats:FindFirstChild("Stand")

local click = part.ClickDetector
if currentStand.Value == "Stand1" then
    local function go(player)

        player.Character.HumanoidRootPart.CFrame = CFrame.new(part.Position + Vector3.new(0,3,0))

    end
end)

You used one equal signs. Make sure to use two in if.. then statements!

1 comment

0

oh ok thanks

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