I couldn't detect any major problems, but I need help to detect a simple problem that can trigger the whole script.
local RepSto = game.ReplicatedStorage local GunPass = RepSto.Val.GunPass local BrusterVal = RepSto.StorageVal.BrusterVal local Guns = RepSto.Guns local Playing = RepSto.Val.PlayingVal local Player = game.Players.LocalPlayer function BrusterGive() local BrusterClone = Guns.Bruster:Clone() BrusterClone.Parent = script.Parent wait(0.1) GunPass.Value = false end function Remove() Player.BackPack:GetChildren().Parent = RepSto.Debris GunPass = false end while wait(1) do if Playing == true then wait(0.1) if GunPass == true then if BrusterVal == true then BrusterGive() print("BrusterGiven") end end elseif Playing == false then if GunPass == true then Remove() end end end
So to explain it better there is a datastore value called Bruster, If that value is true (which it is) then I need to click another gui with another script to equip (which it does) and thats the BrusterVal. the part where the problem occoured is at the GunPass, anything past it wont say or do anything, even though its set to true. The Only thing I can think of is that it is in the server and not the client. but I checked and everythings ok and running, then I figured it must be the function that clones the part, and thats where Im stuck!.