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

Line 21: 'then' expected near '=' I don't understand why my script doesn't work?

Asked by 3 years ago
local uni = game.Workspace:FindChild"Devs"

local playerInventory = game.ReplicatedStorage:FindChild"Inventory"

local uniAmount = playerInventory.Unicorns

local player = game.Players.LocalPlayer

local throwPartyBtn = game.StarterGui.PartyGui.ThrowPartyButton

local throwParty = throwPartyBtn.CallOver --CallOver is a remote event btw



uniAmount = 1000

tradablePet = 1 --Boolean logic, here



if uniAmount = 1000

repeat

playerInventory.Instance.new(uni)

new(uni).tradablePet = 1

until uniAmount = 64794763839



if uniAmount = <1000

player:Kick ("Error with the auto farm.")



throwPartyBtn.MouseButton1Click:Connect(function()

uniAmount = 0

wait(1)

uniAmount = 999 --we want to chill the servers a bit here

wait(1)

new(uni).tradablePet = 0

wait(1)

new(uni).tradablePet = 1

throwParty = false

throwParty = (uni) --something to confuse the rStorage and configure it the way want it to

Line 21: 'then' expected near '=' I don't understand why my script doesn't work? help me

0
If you wanna do boolean logic, use true and false. Roblox uses it for true or false properties, so you should use it as wel. Dovydas1118 1495 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

Theres no repstorage:FindChild, also you forgot the () at the end

local playerInventory = game.ReplicatedStorage:FindChild("Inventory")
Ad
Log in to vote
0
Answered by 3 years ago

try this:

local uni = game.Workspace:FindChild"Devs"

local playerInventory = game.ReplicatedStorage:FindChild("Inventory")

local uniAmount = playerInventory.Unicorns

local player = game.Players.LocalPlayer

local throwPartyBtn = game.StarterGui.PartyGui.ThrowPartyButton

local throwParty = throwPartyBtn.CallOver --CallOver is a remote event btw



uniAmount = 1000

tradablePet = 1 --Boolean logic, here



if uniAmount = 1000

repeat

playerInventory.Instance.new(uni)

Answer this question