My friend used the script on Roblox Studio:
local cas = game:GetService("ContextActionService")
local rs = game:GetService("ReplicatedStorage")
local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")
local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local rightPunch = animator:LoadAnimation(script:WaitForChild("RightPunch"))
local currentPunch = 0
local debounce = false
local function punch()
if debounce then return end
debounce = true
if currentPunch == 0 then
rightPunch:Play()
hitboxEvent:FireServer(Vector3.new(1,1,1), Vector3.new(
5), 50, 0.3)
task.wait(0.4)
debounce = false
elseif currentPunch == 1 then
rightPunch:Play()
hitboxEvent:FireServer(Vector3.new(1,1,1), Vector3.new(2,5), 50, 0.3)
debounce = false
elseif currentPunch == 2 then
rightPunch:Play()
hitboxEvent:FireServer(Vector3.new(1,1,1), Vector3.new(2,5), 50, 0.3)
debounce = false
end
if currentPunch == 2 then
currentPunch = 0
else
currentPunch += 1
end
end
cas:BindAction(“Punch”, punch, true, Enum.UserInputType.MouseButton1)
Screenshot
The script is running perfectly for him, but not for me. The animation will not play on my game but it works on his screen. He was the one who made the animation, but it also works for my other friend. How do I fix this? (Computer: Mac, Apple M3, macOS Sonoma V.14.6.1)
I cleared Roblox studio’s cache. I expected it to work. it did not. (By the way, do NOT use solutions that turn off my firewall)
Godric90_ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.