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