I am working on an “elevator game” and this issue is not helping me.
I have tried tweening a part from serverscriptservice using BindableEvents, RemoteEvents, and also just for the sake of it, doing it directly from the serverscript.
Even with BindableEvents I can’t get it to work.
I am trying to get “ElevatorHandler” to tween “left”.
this is “ElevatorHandler”
ServerStorage = game:GetService("ServerStorage")
ReplicatedStorage = game:GetService("ReplicatedStorage")
Players = game:GetService("Players")
Maps = ServerStorage:WaitForChild('Maps'):GetChildren()
Status = ReplicatedStorage:WaitForChild('Status')
local Remote = game:GetService('ReplicatedStorage'):WaitForChild('Tweener') -- this is the bindableEvent
while true do
--inter
local Countdown = 5
repeat wait(1)
Countdown = Countdown - 1
Status.Value = ''..Countdown
until Countdown <= 0
--Choose the map.
Status.Value = '0'
local ChosenMap = Maps[math.random(1, #Maps)]:Clone()
local Spawns = ChosenMap:FindFirstChild('Spawns'):GetChildren()
local RandomSpawn = Spawns[math.random(1, #Spawns)]
wait(5)
ChosenMap.Parent = workspace
Status.Value = '0'
wait(2)
--this is where i need the doors to open.
Remote:Fire() -- my attempt at making a bindableEvent fire for the tween.
for _, Player in pairs(Players:GetChildren())do
if Player.Character and Player.Character:FindFirstChild('Humanoid') then
Player.Character.HumanoidRootPart.CFrame = RandomSpawn.CFrame
end
end
Countdown = 5 --the floor starts
repeat wait(1)
Countdown = Countdown - 1
Status.Value = '0'..Countdown
until Countdown <= 0
Countdown = 5 -- Game Time, ten seconds so the video isn't long, make this as long as you want.
repeat wait(1)
Countdown = Countdown - 1
Status.Value = 'ingame: '..Countdown
until Countdown <= 0
--despawn
for _, Player in pairs(Players:GetChildren())do
if Player.Character and Player.Character:FindFirstChild('Humanoid') then
Player.Character.Humanoid:TakeDamage(2000)
end
end
ChosenMap:Destroy()
Status.Value = 'rounds ended'
wait(4)
end
This is the script inside the “Doors” model which recieves the event, and tries to tween.
local Remote = game:GetService('ReplicatedStorage'):WaitForChild('Tweener')
Remote.OnClientEvent:Connect(function()
script.Parent.left:Destroy()
end)
^ I made it destroy the part to check if the event was even working, it was not.
There originally was a Tween.
Any help would be so much appreciated!