script.Parent.Touched:Connect(function(thingy)
print(thingy)
if canParry.Value == true then
if thingy:GetAttribute("Type") == "Projectile" then
sound:Play()
thingy:Destroy()
elseif thingy:GetAttribute("Type") == "Attack" then
soundd:Play()
print("stun bad guy")
else
print("that nothing")
end
end
end)
its not even printing thingy for some reasonn.
these are the targetss (not anchored)
the gray box contains the script (it can’t collide)
Print something before the connection just to make sure that section of the code is running. That is all I can think of. If it is running double check what script.Parent is.
I don’t think it has to be in replicated first in order for it to detect stuff. I’m pretty sure it will detect it as long as it runs, but someone correct me if I’m wrong.
yaa im 90 percent sure its being set to truee, also I added a newww line that is supposed to print hi
local canParry = script.Parent.Parent:WaitForChild("ParryWindow")
local sound = script.parry
local soundd = script.parry2
print("hi")
script.Parent.Touched:Connect(function(thingy)
print(thingy)
if canParry.Value == true then
if thingy:GetAttribute("Type") == "Projectile" then
sound:Play()
thingy:Destroy()
elseif thingy:GetAttribute("Type") == "Attack" then
soundd:Play()
print("stun bad guy")
else
print("that nothing")
end
end
end)
local char = script.Parent
local animate = script:WaitForChild("Parry")
local hum = char:WaitForChild("Humanoid")
local animationn = hum.Animator:LoadAnimation(animate)
local ParryWindow = char.ParryWindow
local parryCD = false
UserInputService.InputBegan:Connect(function(input, bruh)
if not bruh and input.KeyCode == Enum.KeyCode.F and not parryCD then
parryCD = true
hum.WalkSpeed = 0
ParryValueSwitcher:FireServer()
animationn:Play()
animationn.Stopped:Wait()
parryCD = false
hum.WalkSpeed = 16
end
end)
that fire remote, here the remote::
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ParryValueSwitcher = ReplicatedStorage:WaitForChild("ParryValueSwitch")
ParryValueSwitcher.OnServerEvent:Connect(function(plr)
local boolll = plr.Character:WaitForChild("ParryWindow")
boolll.Value = true
task.wait(0.3)
boolll.Value = false
end)
So I think the issue is that since the part is created locally, the server doesn’t detect it – if you captured the Touched on the client and used a RemoteEvent to fire the server, it should work