local lp=game:GetService("Players").LocalPlayer
local rs=game:GetService("RunService")
local m=lp:GetMouse()
local df=lp:WaitForChild("DataFolder")
local ev=game:GetService("ReplicatedStorage"):WaitForChild("Shoot")
local f,c=false,nil
local function lockGunDelay()
local g=df:FindFirstChild("GunDelay")
if g then
g.Value=-100
g:GetPropertyChangedSignal("Value"):Connect(function() g.Value=-100 end)
end
end
lockGunDelay()
df.ChildAdded:Connect(function(c) if c.Name=="GunDelay"then lockGunDelay()end end)
local function startFire()
if f then return end
f=true
c=rs.Heartbeat:Connect(function()
if f then
pcall(function() ev:FireServer() end)
end
end)
end
local function stopFire()
f=false
if c then c:Disconnect() c=nil end
end
m.Button1Down:Connect(startFire)
m.Button1Up:Connect(stopFire)
lp.CharacterAdded:Connect(function()
task.wait(0.2)
lockGunDelay()
if f then startFire() end
end)
Comments
No comments yet
Be the first to share your thoughts!