I want to make an exit for a Horror game me and my friend are working on. I want there to be a white screen that changes to a black screen and then makes text appear when exiting.
I tried to tween the colors from going white to black witch was the problem. The output box says: ‘‘Unable to cast to dictionary’’ I have no idea what that means, but basically it made the white screen pop up but it didn’t change to black after a few seconds.
This is the script:
local part = script.Parent
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(1)
local Light = game.StarterGui.ExitGUI.Light
local goal = {}
goal = Light.BackgroundColor3 == Color3.new(0)
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if not player.PlayerGui.ExitGUI.Light.Visible then
player.PlayerGui.ExitGUI.Light.Visible = true
local tween = TweenService:Create(Light, tweenInfo, goal)
tween:Play()
end
end
end
end)
I had just gotten into working with TweenService so I’m pretty new to it and would like to know more about it. I had one success with it by smoothly rotating and moving objects when clicked.