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

[Closed] Why is the Clone of the Gun not working/being distributed when told?

Asked by 5 years ago
Edited 5 years ago
  • UPDATE - I figured it out myself, there was a weird function in the way, there was problems with ending values with .Value, and It was in a incorrect service.

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!.

Answer this question