Remote Event Tween

  1. What do you want to achieve?
    I am currently working on the SurfaceGUI Station Home Door system. And I want to use remoteevent for checking player team.

  2. What is the issue?
    Tween doesn’t work.

  3. What solutions have you tried so far?
    There was no solutions, I can find it.

SCRIPTS BELOW
Local

local OPEN = script.Parent.Parent.Screen.SurfaceGui.Frame.OPEN
local CLOSE = script.Parent.Parent.Screen.SurfaceGui.Frame.CLOSE

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvent = ReplicatedStorage:WaitForChild("CLOSE")

local remoteEvent2 = ReplicatedStorage:WaitForChild("OPEN")

local plr = game.Players.LocalPlayer

OPEN.MouseButton1Click:Connect(function()
		remoteEvent2:FireServer()
end)

CLOSE.MouseButton1Click:Connect(function()
		remoteEvent:FireServer()
end)```
Server
```lua
local TweenService = game:GetService("TweenService")

local Door = game.Workspace.test.Door5.door
local Open = game.Workspace.test.Door5.open
local close = game.Workspace.test.Door5.close


local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvent = ReplicatedStorage:WaitForChild("CLOSE")

local remoteEvent2 = ReplicatedStorage:WaitForChild("OPEN")

--Open platform door
local Opengoal = {}

Opengoal["Size"] = Open.Size
Opengoal["Color"] = Open.Color
Opengoal["CFrame"] = Open.CFrame

--Close platform door
local Closegoal = {}

Closegoal["Size"] = close.Size
Closegoal["Color"] = close.Color
Closegoal["CFrame"] = close.CFrame

--Open play
local tweeninfo = TweenInfo.new(4)
local OpenTween = TweenService:Create(Door, tweeninfo, Opengoal)
local CloseTween = TweenService:Create(Door, tweeninfo, Closegoal)

local function OPEN2()
	OpenTween:Play()
end

local function CLOSE2()
	CloseTween:Play()
end

remoteEvent.OnServerEvent:Connect(CLOSE2)

remoteEvent2.OnServerEvent:Connect(OPEN2)


Can you describe more about the tween? What is supposed to happen? How does this tween relates to your issue?

Okay. So there is a UI Button inside of the part and if player press OPEN Button the door will be open, but at this moment. I have to use the remote event to check player’s team.
On the video 1 bar is not working and only that bar is setted the remote function and doesnt work.

https://gyazo.com/b8c4cffa13afab1b07f786e755993c40

Is the door a model of parts or individual parts? It seems like you did not include that unmoved bar into the tweening process.

image

Sorry for my bad English. Here is the workspace.

What are the classes for the close, door, and open instances?

Union? I don’t know what is instances… (Please don’t mind my bad English.)

Your English is fine, don’t worry.
You should probably rename the unions to have a capital letter at the start, because it looks like you might be using the names of some globals in your script.

1 Like

Never mind, ignore what I just said.

Can you identify what is the name of the bar that is not moving in the video? Have you made sure you tween that bar? Because I feel like you are using individual server scripts to tween each bar.

1 Like

Yes. I am using server scripts to tween it. Bar name is door. There is 5 models and each models have close, open and door and door is bar or side one. And I am using local script to check player’s team. Because I am using the surfaceGUI.

That doesn’t make sense at all. There are 4 bars shown in the video, why is there 5 in the image? Also, please be specific which number of the bar is not moving.

You should never put local scripts in workspace unless it is a descendant of the player’s character. If you want your local scripts to run, put them in services like StarterGui.

1 Model = 1 PART (Part Name: Door, close, open)


That is the bar picture. Which the part name is door.

Still not specific enough. Which door number is this bar located under? door1? door2? door3?

Why not weld all of the door parts to a Primary part and tween the Primary part instead?

1 Like

From up
MODEL
Door3 top
Door4
Door5
Door1

Door2 is side one.

So I assume Door5 is the bar that is not moving as shown in the video.

Have you made sure the script is running? Did the OPEN2() function run? Use print statements to help you identify which part of your script does not run.

1 Like

Script is not running. Hm? What I do now.

Have you made sure the script is running or not? You can test it by using print statements. If the print statements are shown in the output tab then it means the script is running, otherwise it isn’t. Check if your server script is running.

1 Like

no all doesnt work from local too