Other players can see tween

i have a module for tweening but other players can see it even if i call it from the client but when i press the button that switches between client and server i dont see the tween happening but when there is 2 player both of them can see it but i only want the one who touched it to see it

local module = {
	Tween = function(part, vector3, fireRemote, HasBillboard)
		local debounce = {}
		local tweenservice = game:GetService("TweenService")
		local tweenpart = part
		if not tweenpart then
			tweenpart = game.Workspace:WaitForChild("maingame").tweenparts.slowparts:WaitForChild(part)
		end
		local duration = tweenpart.duration.Value
		local repeatdelay = tweenpart.repeatdelay.Value
	
		local originalPosition = tweenpart.CFrame
		local originalSize = tweenpart.Size

	
		local tweeninfo = TweenInfo.new(
			duration,  
			Enum.EasingStyle.Linear, 
			Enum.EasingDirection.Out, 
			0, 
			false,  
			0 
		)


		local target = {
			Size = tweenpart.Size + vector3,  
		}




		tweenpart.Touched:Connect(function(hit)
			if game.Players:GetPlayerFromCharacter(hit.Parent) then
				if not debounce[part] then
					debounce[part] = true

					local tween = tweenservice:Create(tweenpart, tweeninfo, target)

					tween:Play()
					if fireRemote then
						game.ReplicatedStorage.countdownevent:Fire(tweenpart,duration,repeatdelay, HasBillboard)
					end
					tween.Completed:Wait()

					wait(repeatdelay)

					tweenpart.CFrame = originalPosition
					tweenpart.Size = originalSize

					debounce[part] = false
				end
			end
		end)

	end,
}

return module

If you only want the client that touched the part to see the tween, create and play the tween on that client.
If you want all clients to see the tween, create and play the tween on the server.

1 Like

that what i did
charrrrrrrrr limit

You are running this on the server, no?

.Touched doesn’t work on the client so I’m going to assume you are.

If you are running this on the client then is the part anchored (could be to do with network ownership if not)?

yes the touched event was on client that is why other could see and i fixed the problem thanks

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