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

Help with a a weird error?

script.Parent.ClickDetector.MouseClick:connect(function(player)
	game.ReplicatedStorage.times.Value = 60
	local farm = game.ReplicatedStorage.farm:Clone()
	local farm1 = game.Workspace.farm
	game:GetService("Debris"):AddItem(farm1,1)
	wait(.5)
	farm.Parent = game.Workspace
end)

Script:3: '=' expected near 'end'

why is = expected near end on line 3? there isn't and end on line 3, so i don't get whats going on

1 answer

This may help, scripts get confused with integers in the variable names, that might be the problem.

Rewritten Script:

local RStorage = game:GetService("ReplicatedStorage")
local farm = RStorage.farm
local farmA = game.Workspace.farm


script.Parent.ClickDetector.MouseClick:connect(function(player)
    game.ReplicatedStorage.times.Value = 60
    local CFarm = farm:Clone()
    game:GetService("Debris"):AddItem(farmA, 1)
    CFarm.Parent = game.Workspace
end)

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