I'm making a DBZ game with my friend, and when we fire the event it doesn't fire. A little help?
LocalScript that is supposed to fire the event.
player = game.Players.LocalPlayer
repeat wait() until player.Character
wait(3)
character = player.Character
mouse = player:GetMouse()
local Humanoid = character.Humanoid
local animation = game.Workspace.Punch1
local dmg = 4
local Player = game.Players.LocalPlayer
local Input = game:GetService("UserInputService")
local deb = false
local punching = false
function Contact(hit)
if deb == false and punching then
deb = true
if hit.Parent then
local Stunner = hit.Parent:FindFirstChild("Stun")
local ehuman = hit.Parent:FindFirstChild("Humanoid")
print('maybe dood?')
if Stunner and ehuman then
if Stunner:IsA("BindableEvent") then
Stunner:Fire(dmg)
print('wot a wot woot how')
end
end
end
end
end
Input.InputBegan:connect(function(key, gpe)
local Tag = character:FindFirstChild("HitStun")
if key.KeyCode == Enum.KeyCode.E and Tag == nil and not gpe then
if punching == false then
punching = true
T0 = Humanoid:LoadAnimation(animation)
T0:Play()
T0.KeyframeReached:connect(function(key)
if key == "contact" then
print('bam')
character:FindFirstChild("Right Arm").Touched:connect(Contact)
end
end)
T0.Stopped:connect(function()
deb = false
punching = false
end)
end
end
end)
other LocalScript that is supposed to receive it.
p = game.Players.LocalPlayer
repeat wait() until p.Character~=nil
local chr = game.Players.LocalPlayer.Character
local Stunner = chr:WaitForChild("Stun")
local Int = script.Var
print(chr)
print(Int.Parent)
print(Stunner.Parent)
function Tag()
local tag = Instance.new("BoolValue")
tag.Name = "HitStun"
tag.Parent = chr
local removal = script.Removal:clone()
removal.Parent = tag
removal.Disabled = false
end
Stunner.Event:connect(function(dmg)
print('received')
local human = chr:FindFirstChild("Humanoid")
if human then
print('stunned')
local var = math.random(1,2)
Int.Value = var
human:TakeDamage(dmg)
if Int.Value == 1 then
Tag()
local T0 = human:LoadAnimation(script.Stun1)
T0:Play()
end
if Int.Value == 2 then
Tag()
local T0 = human:LoadAnimation(script.Stun2)
T0:Play()
end
end
end)
The Event does not work no matter how many times I look through.
Note: I tried to use RemoteEvents as well.

2 comments
does the event have a child that fires
I mean the bullet. does the event have anything to fire?