So, I made this script to resize a GUI to make a transition, but it doesn't work.
SCRIPTS:
Script 1: Part Script (Server Script)
local db = true
script.Parent.Touched:Connect(function(hit)
if db == true then
print("Part hit")
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
db = false
print("Humanoid detected")
local plrName = hit.Parent.Name
local plr = game.Players:FindFirstChild(plrName)
if plr ~= nil then
print("Player detected")
local event = game.ReplicatedStorage.Events.DoorEntered:FireClient(plr,h,db)
wait(5)
db = true
end
end
end
end)
Script 2: Event Script (Local Script, inside StarterPlayerScripts)
events.DoorEntered.OnClientEvent:Connect(function()
local plr = game.Players.LocalPlayer
local gui = game.StarterGui.TransitionGUI
local ts = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
1, -- Time
Enum.EasingStyle.Quad, -- EasingStyle
Enum.EasingDirection.InOut, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween = ts:Create(gui.bottom, tweenInfo, {Position = UDim2.new(1,0,0.5,0)})
tween:Play()
local tween = ts:Create(gui.top, tweenInfo, {Position = UDim2.new(1,0,0.5,0)})
tween:Play()
local tween = ts:Create(gui.right, tweenInfo, {Position = UDim2.new(0.5,0,1,0)})
tween:Play()
local tween = ts:Create(gui.left, tweenInfo, {Position = UDim2.new(0.5,0,1,0)})
tween:Play()
end)
ADDITIONAL INFO:
- No errors in output
- Event in an "Events" folder in ReplicatedStorage
- Part is a union

2 comments
Still doesn't work.
Is it printing anything in the output?