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

Help with a a weird error?

Asked by 8 years ago
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

Log in to vote
0
Answered by
legosweat 334 Moderation Voter
8 years ago

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)
Ad

Answer this question