wait(1)
d = true
script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if d == true then
d = false
print'fgf'
local targetPos = game.Players.LocalPlayer:WaitForChild("Character").Humanoid.TargetPoint
local lookAt = (targetPos - game.Players.LocalPlayer:WaitForChild("Character").Head.Position).unit
print'wwwwwwwwwwwwwwwwwwww'
local p = Instance.new("Part")
p.Position = script.Parent.Handle.Position
p.Parent = game.Workspace
p.CanCollide = true
p.Name = script.Parent.Parent.Name
p.Size = Vector3.new(.4,.4,.4)
p.BrickColor = BrickColor.new("New Yeller")
p.Velocity = lookAt * 300
local Bforce = Instance.new("BodyForce", workspace)
Bforce.Parent = p
Bforce.force = Vector3.new(0, 196.2, 0) * p:GetMass()
local s = game.ReplicatedStorage.hit:Clone()
s.Parent = p
s.Disabled = false
game:GetService("Debris"):AddItem(p, 5)
wait(.5)
d = true
end
end)
end)
this doesnt work in studio, and if it isnt working in studio, im just guessing it wont work in player. hit is the damage script for this gun, im not going to show it because there is no need to, because this script only prints fgf. if i take out the waitforchilds, it works in studio, but still not in player.
