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.
What is the issue?
Tween doesn’t work.
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)
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.
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.
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.
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.
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.
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.