Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

is it possible to tween a object when a remote function is fired?

im making a game based off the japanese game show the death pit.i want it so when someone says ready the platform will move. Can some one help me with my script? the first script is in serverscriptservice if that affects this

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		if message == "ready" or "Ready" then
			game.ReplicatedStorage["Start Game"]:FireServer()
	end
end)
local TweenService = game:GetService("TweenService")
local PlatForm = script.Parent.Parent:WaitForChild("DisapearPart")
local tweeningInformation = TweenInfo.new(
    5,   
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)
local Move = {CFrame = CFrame.new(99.125, 177.707, -262.83)}
local ComeBack = {CFrame = CFrame.new(99.125, 177.707, -215.915)}
local tween1move = TweenService:Create(PlatForm,tweeningInformation,Move)
local tween1comeback = TweenService:Create(PlatForm,tweeningInformation,ComeBack)
 
game.ReplicatedStorage["Start Game"].OnServerEvent:Connect(function(player)
    tween1move:Play()

    wait(70)
    tween1comeback:Play()

end)

1 answer

✓ Accepted answer

I would do it all in 1 script since they're both on the server

local plr = game:GetService("Players").LocalPlayer
local TweenService = game:GetService("TweenService")
local PlatForm = game:GetService("Workspace").DisapearPart

local tweeningInformation = TweenInfo.new(
    5,   
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)

local Move = {CFrame = CFrame.new(99.125, 177.707, -262.83)}
local ComeBack = {CFrame = CFrame.new(99.125, 177.707, -215.915)}
local tween1move = TweenService:Create(PlatForm,tweeningInformation,Move)
local tween1comeback = TweenService:Create(PlatForm,tweeningInformation,ComeBack)


game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)
        if message:lower() == "ready" then
   			tween1move:Play()
   			wait(70)
   			tween1comeback:Play()
		else
		print("Unknown")
        end
    end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.