#Script not working
23 messages · Page 1 of 1 (latest)
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = script.Parent
local char = Player.Character or Player.CharacterAdded:wait()
print('finding humanoid')
repeat wait() until char:FindFirstChild("Humanoid")
print('found')
local humanoid = char.Humanoid
local Mouse = Player:GetMouse()
local Loaded = false
local debounce = false
local Tool = script.Parent
local Event = ReplicatedStorage:FindFirstChild('ShootEvent')
local Holdable,Holding = false,false
function Send()
Event:FireServer({Position = Mouse.Hit.Position})
end
Tool.Activated:Connect(function()
if debounce == true then
if Loaded == false then
local OGspeed = humanoid.WalkSpeed
humanoid.WalkSpeed = 3
wait(3)
humanoid.WalkSpeed = OGspeed
else
debounce = true
Holding = true
if Holdable then
local Run
Run = RunService.Heartbeat:Connect(function()
if not Holding then
Run:Disconnect()
end
Send()
end)
else
Send()
end
wait(1.5)
debounce = false
Loaded = false
end
else
return
end
end)
Tool.Deactivated:Connect(function()
Holding = false
end)
Tool.Unequipped:Connect(function()
Holding = false
end)```
it's a local script, and this script is supposed to get player's mouse / checking debounce before the weapon shoots
** You are now Level 7! **
?
yes inside a tool
let me see what i can do
i think this can help
wait let me try my own way first i might know where im wrong at
what was the issue?
it was more of a sequence problem
thank u u too
Bye