-
What do you want to achieve? Keep it simple and clear!
I am making a script to tween a models position to the players mouse, but I only want it to work on the client side. -
What is the issue?
It is only tweeting the primary part even though the whole model is welded to the primary part.
-
What solutions have you tried so far?
Ive tried messing around with the welds and I have not had much luck.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
--This is a local script in the tool
local TS = game:GetService("TweenService")
local ToolFolder = game:WaitForChild("ReplicatedStorage"):WaitForChild("Tools")
local FTFolder = ToolFolder:WaitForChild("FakeTools")
local LPlayer = game.Players.LocalPlayer
local Mouse = LPlayer:GetMouse()
local MoveFunction = nil
local TInfo = TweenInfo.new(.2)
script.Parent.Equipped:Connect(function()
local FakeModel = FTFolder:WaitForChild("FakeBarricadePW"):Clone()
FakeModel.Parent = game.Workspace
local PartToMove = FakeModel:WaitForChild("Main")
MoveFunction = Mouse.Move:Connect(function()
local Filter = LPlayer.Character:GetDescendants()
local Param = RaycastParams.new()
Param.FilterType = Enum.RaycastFilterType.Exclude
Param.FilterDescendantsInstances = Filter
local raycastResult = workspace:Raycast(Mouse.UnitRay.Origin, Mouse.UnitRay.Direction * 250,Param)
if raycastResult then
local raycastHit = raycastResult.Instance
if raycastHit then
local ExactPos = raycastResult.Position
local goal = {}
goal.Position = ExactPos
local Tween = TS:Create(PartToMove,TInfo,goal)
Tween:Play()
end
end
end)
end)
Is there some way to go about with this?