this is a update repost, im sorry, but i rlly needs this to be fixed, and im actually dying by trying to figure this out
so i made a script that makes player punches, it all works fine but when i publish it and get into the real game, it sometimes doesn’t work, around character dies for 3 times, or when i change a character, it doesn’t fire the remote event anymore, i used a lot of prints to let me know wat’s the problem, but it didnt print anything including the “Fired” so i presume the problem is on this script
update:
i got different characters in the game so i use the line
if c:FindFirstChild("AceHair")then
to see which character it is, and i dont know if that’s causing the problem or not, i rlyl cant find whats wrong, everything works completely fine in studio test modes, includes the local server mode, but in the published version it just doesnt work
i worked so hard on this project and this is the actual last step for it to be complete or else it just gon to be a waste, so if anyone can help me i would rlly rlly rlly appreciate them
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local c = player.Character
repeat wait() until c:FindFirstChild("Humanoid")
local mouse = player:GetMouse()
local ReplicatedStorage = game.ReplicatedStorage
local UserInputService = game:GetService("UserInputService")
local Debounce = false
local function punchCD()
Debounce = true
wait(0.5)
Debounce = false
end
UserInputService.InputBegan:Connect(function(Input,IsTyping)
if IsTyping then print("IsTyping") return end
if Input.KeyCode == Enum.KeyCode['Space']then
if c.Humanoid.Health ~= 0 then
if c:FindFirstChild("Stunned") then return end
if Debounce == true then print("SkillCoolingDown") return end
if c:FindFirstChild("AceHair")then
if c:FindFirstChild("UsingSkill")then return
else
ReplicatedStorage.AcePunch:FireServer()
print("Fired")
Debounce=true
punchCD()
end
end
end
end
end)