"Client-sided" Part Can be Touched by Others

What do I want to achieve? I am trying to simply create a client-sided sphere that can only be touched by the client that can see it.

What is the issue? Only the client can see it, but the sphere can still be touched by others.

Local Script inside of StarterGUI:

--PRESET VARIABLES
local originalBall = game.ReplicatedStorage.Ball:Clone()
local pos = Vector3.new(329, 6.1, -152)
local zeroVelocity = Vector3.new(0,0,0)
originalBall.Parent = workspace

--//VARIABLES
local ball = game.Workspace:WaitForChild("Ball")
local tragedy = game.SoundService.bird
local BoulderGUI = script.Parent
local mainPart = game.Workspace.RandomStuff.BoulderPush.Part2

--TWEENS
local TweenService = game:GetService("TweenService")
local tween = TweenService:Create(BoulderGUI, TweenInfo.new(5, Enum.EasingStyle.Linear), {ImageTransparency = 0})
local tween2 = TweenService:Create(BoulderGUI, TweenInfo.new(5, Enum.EasingStyle.Linear), {ImageTransparency = 1})
local soundTween = TweenService:Create(tragedy, TweenInfo.new(5), {Volume = 0})

--//TOUCH
mainPart.Touched:Connect(function(hit)
	if hit.Name == "Ball" then
		tragedy.Volume = 7
		mainPart.Parent = nil
		tragedy:Play()
		tween:Play()
		task.wait(10)
		soundTween:Play()
		tween2:Play()
		mainPart.Parent = game.Workspace.RandomStuff.BoulderPush
		ball.Position = pos
		ball.AssemblyLinearVelocity = zeroVelocity
		ball.AssemblyAngularVelocity = zeroVelocity 
	end
end)

Video Example:

just add a check.

if hit.Parent == game:GetService("Players").LocalPlayer.Character then
-- do your code here
end

Unfortunately, even with this implemented, it still seems to have the same issue.

Search up collisionGroups. That’s what your looking for.

2 Likes

Thank you; I’ll look into collisionGroups.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.