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

Why wont this work?

Asked by 8 years ago

So i made this script and it doesnt work, I did what i could also getting help by other people

repeat wait() until game.Players.LocalPlayer.Character

Player = game.Players.LocalPlayer
Cube = script.Parent
local Workspace = game.Workspace
mouse = Player:GetMouse()
function onEquipped()
Cube.Handle.Equipped:Play() 
end

local GearFolder = game.ServerStorage.SwordsFolder


local MovementGearNames = {
"BlackAndWhiteWingedSword",
"BombosSurvivalKnife",



}


function Click()
while true do
for i,v in pairs(GearFolder:GetChildren())do
if v.Name == MovementGearNames[math.random(1, #MovementGearNames)] then
wait(0.01)
v.Enabled = true
local Sound = Instance.new("Sound",script.Parent.Handle)
Sound.SoundId = "rbxassetid://163362522"
Sound.Volume = 1
Sound.Pitch = 1
Sound.Looped = false
Sound.Name = "GearSound"
local Gear = v:Clone()
Gear.Parent = Player.Backpack
Sound:Play()
print(Player.Name,"Got", v.Name.."!")
wait(0.01)
script.Parent:Destroy()

end
end
end







end




Cube.Activated:connect(Click)
Cube.Equipped:connect(onEquipped)



1
It would be helpful if you could describe what it does or doesn't do and what errors occur (if any) chess123mate 5873 — 8y
0
Could you also tell us what it's supposed to do? ProtectedMethod 105 — 8y
0
Well, What i want it to do is get a random gear wrong a folder and copy it to the players backpack.But i doesnt work but only on studio.. UltraUnitMode 419 — 8y

Answer this question