Play PartTween from a local script

Hello guys, I want to know, if there’s any way to play this script from a localscript in StarterGui:

> local TweenService = game:GetService("TweenService") 
> local tweenPart = game.Workspace.Fall.CameraPart 
> local info = TweenInfo.new(
> 	80,         
> 	Enum.EasingStyle.Linear,     
> 	Enum.EasingDirection.InOut,   
> 	0,                  
> 	true,               
> 	0                    
> )
> 
> local Goals = {           
> 	Position = Vector3.new(-436.548, 253.709, 1926.019), 
> }
> 
> local PartTween = TweenService:Create(tweenPart, info, Goals) 
> PartTween:Play()
1 Like

Use remote events/functions or else you can’t :<

1 Like

I’ve tried, but I’m new at this and don’t know how exactly…

1 Like

well you could put a local script in starterplayerscripts that could work?

I need it to be in StarterGui… :confused:

maybe make the script go into the player scripts? im not that good at scripting btw

This module might be what your looking for?

1 Like

here’s an example:

localscript:

local remoteFunction = ReplicatedStorage:WaitForChild("RemoteFunctionTest")
--Script
remoteFunction:InvokeServer()

script:

remoteFunction.OnServerInvoke = function(Player)
    --TweenCode
end

Is it not working? I don’t see what the issue is. This script should work just fine as it is, unless you are referencing something incorrectly.

Why would they need RemoteFunctions to tween a part?

Idk if it matter, but I’m trying to tween it from the client and not server

It doesn’t matter. You can most definitely do this. Just keep in mind it only tweens for that individual player.

Oh yeah, I was trying to test it by using “Run” but it only works in if you test in “Play”
Thank you very much bro :wink:

1 Like