Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can't .Touched be fired by clients on parts with networkonwer = server?

I am making a physics game and I wanted to check .Touched() from client just to apply some effects.

The problem is it that the event doesn't fire everytime. I thought that maybe the NetworkOnwer changed when i got further away, and that somehow caused the event to break, so I put a code to part:SetNetworkOnwer() so the part owner never changes. Now the touched event doesn't fire at all from localscripts, is it really impossible to use .Touched locally on objects with network set to server?

1 answer

✓ Accepted answer

Well, I have personally tried in studio when setting the NetworkOwner to nil. But, yes, the Touched event triggered. You can add print just after the Touched event for debugging purposes.

If you want to know what I used :

-- Server script in the Part
script.Parent:SetNetworkOwner(nil)

-- Local Script
local function Debug()
	print("GG")
end

workspace.Part.Touched:Connect(Debug)

-- Output
-- GG in Client-Side

Lemme know if it helps!

1 comment

0

Hmm, maybe there is another problem I made that isnt binding the event to the bullets when they spawn on client, but thanks.

This discussion is preserved as it was. New answers, comments, and votes are closed.