.Touched event only seems to run in Studio and not in a Game or Test Server?

I’ve been working on it in a separate place so none of the code or assets in it are worth anything.

Already posted half the code on this post.

IHateTouchedEvents.rbxl (23.4 KB)

I downloaded the place just to let you know

That’s fine!

Something is wrong I don’t have any sword when I spawn, and after the script prints >> Baseplate it seems like it deleted itself

script.Parent.Touched:Connect(function(hit)
	print(hit)
end)

Maybe the sword mesh didn’t get approved, so that could be the problem.

Nope, the mesh got approved. So that’s not the problem. e.e

Why aren’t you using a tool for this?

I checked the Mesh it’s fine, I can see it

Because I don’t want to ( I guess is the answer? ). It feels nicer when the player doesn’t click 1 to equip / unequip. At least to me.

The problem is the Sword is not welded and it falls into the void and gets deleted

player.CharacterAdded:Connect(function(character)
	local weapon = game.ReplicatedStorage.Greatsword:Clone()
	weapon.Motor6D.Part0 = character:WaitForChild("RightHand")
	weapon.Name = "Weapon"
	weapon.Parent = character
end)

This is in the script inside serverscriptservice so that can’t be the case.

And if the sword is not welded and falls into the void, then I would not see it in my hand when I play a test server or the actual game.

Motor6D , I’m not entirely sure but I don’t think it’s a weld, it’s just a motor that moves Part A & Part B

and it does get deleted I saw the sword in my character disappeared, the script has no reference to itself, I tried clicking the Print from the script and I couldn’t

https://gyazo.com/af708abd3db692de2e65940f4b9dca52

I only changed the Sword to CanCollide = true

I’m pretty sure if I use normal Welds then I can’t animate at all.

I’m not really sure why it’s doing that for you, doesn’t happen for me and I’ve tested it numerous times. ;/

I have no idea, but Motor6D behalves like a Weld I tested it

Is your character R6 or R15, it’ll only work if you’re R15.

Okay so I have done manually changed the Part0 in the Motor6D to my RightHand

and done some printing

script.Parent.Touched:Connect(function(hit)
	print(Swinging , hit.Parent , hit.Parent:FindFirstChildOfClass("Humanoid") , game.Players:GetPlayerFromCharacter(hit.Parent))
    if Swinging and hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid") and game.Players:GetPlayerFromCharacter(hit.Parent) then
		hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10
	end
end)

Output >> true Dummy Humanoid nil

Is this in a test server?

no, I am doing a Server Test right now

image

Not experiencing this. Didn’t change any code.