HELP please! this script isn't working

I do not speak english as many people do

  1. So, i’ve been working for a while in this script but it still doesn’t work, i had no errors or outputs.

  2. The Script is about a jojo stand character, his abilities includes this: remote explosion.
    Since he touched you, you turns into a bomb that can be detonated.

  • so here is the script inspired in it:
local rp = game:GetService("ReplicatedStorage")
local Punch = rp:WaitForChild("KiraQueen"):WaitForChild("Explosion")
local Debris = game:GetService("Debris")

local damage = 10
local attacked = false
local target
local targetdebounce = false

Punch.OnServerEvent:Connect(function(Player)
	if attacked == false then
	local Character = Player.Character
	local Humanoid = Character:WaitForChild("Humanoid")
	local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
	
	local Stand = workspace:FindFirstChild(Player.Name.." Stand"):WaitForChild("Dummy")
	
	local folder = Instance.new("Folder",workspace)
	folder.Name = Player.Name.." Explosion"
	Debris:AddItem(folder,.5)
	
	if Stand then
		local prevWeld = Stand:WaitForChild("HumanoidRootPart"):WaitForChild("Stand Weld")
		prevWeld:Destroy()
		
		Stand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(0,-.5,-2)
		
		local weld = Instance.new("ManualWeld")
		weld.Name = "Stand Weld"
		weld.Part0 = Stand:WaitForChild("HumanoidRootPart")
		weld.Part1 = HumanoidRP
		weld.C0 = Stand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
		weld.Parent = weld.Part0
		
			local Hand = Stand:WaitForChild("LeftHand")
			local animControl = Stand:WaitForChild("AnimControl")
			local Punch = animControl:LoadAnimation(script:WaitForChild("LeftPunch"))
			Punch:Play()
			
			local HitBox = script:WaitForChild("HitBox"):Clone()
			HitBox.CFrame = Hand.CFrame
			HitBox.Parent = folder
			
			local Pweld = Instance.new("Weld")
			Pweld.Part0 = HitBox
			Pweld.Part1 = Hand
			Pweld.C0 = HitBox.CFrame:inverse() * Hand.CFrame
			Pweld.Parent = Pweld.Part0
			
			HitBox.Touched:Connect(function(Hit)
				if Hit:IsA("Part") or Hit:IsA("MeshPart") then
					if Hit.Parent ~= Character then
						local EHumanoid = Hit.Parent:FindFirstChild("Humanoid")
						if EHumanoid then
							
							HitBox:Destroy()
							
						if targetdebounce == false then
							targetdebounce = true
							target=Hit.Parent.Name
							attacked = true
						end
						end
					end
				end
			end)
			
			wait(.5)
			local prevWeld = Stand:WaitForChild("HumanoidRootPart"):WaitForChild("Stand Weld")
			prevWeld:Destroy()
			
			Stand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(2,0,2)
			
			local weld = Instance.new("ManualWeld")
			weld.Name = "Stand Weld"
			weld.Part0 = Stand:WaitForChild("HumanoidRootPart")
			weld.Part1 = HumanoidRP
			weld.C0 = Stand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
			weld.Parent = weld.Part0
			
		elseif attacked == true then
			
			else
														
				local sound = Instance.new("Sound",folder)
				sound.SoundId = "rbxassetid://2174934844"
				sound.Volume = 1
				sound:Play()
				Debris:AddItem(sound,.5)
							
				local t = workspace:FindFirstChild(target)
				if t~=nil then
					t:BreakJoints()
				end
			
		end
		
	end
	
end) 

So, it just doesn’t work.
-It only plays the animation

oh, the remote event is fired when player press ‘x’ and the serverscript is focused on the stand not player:

Model > AnimControl

THE GAME : JoJo: Untitled Adventure - Roblox

2 Likes

If theres no errors in the output maybe its like a logical error, I’m not sure try to read through the code again

1 Like

i cant find any solution or bad arguments on the script :sob: :sob: :sob: :sob: :cry:

Where does the script run up to? Have you tried adding prints to parts in the scripts?

player : local script fire server by key pressing
server: remote event got fired actives the server script
when ‘x’ arepressed only the animation plays, it hits the dummy, but when pressed again it doesnt work anymore. By reseting, the animation still not playing. :sob:

I am taking a guess at this…

inside the check if attack==true,

you should reset attack = false,

after your attack is complete.

I see you doing this:

	
		elseif attacked == true then
			
			else

and it is empty, doing nothing… try

	
		elseif attacked == true then
			   attacked=false
			else

but it seems that the sound that’s happening in your “else” after that would be for the attack? maybe take out that “else”, as well.

I hope this helps. :slight_smile:

1 Like

Srry for no replies, i got occupied with school. Thanks for ur help ill be testing as soon as possible