I'm using a normal script inside of a part to make the game's Fog turn to black. What am I doing wrong here?
local OtherworldPart = script.Parent
local DarkenFog = game.Lighting.FogColor
function onTouch(part)
local otherworldGui = Instance.new("ScreenGui")
otherworldGui.Parent = game.Players.LocalPlayer.PlayerGui
local otherworldText = Instance.new("TextLabel")
otherworldText.Parent = otherworldGui
otherworldText.Position = UDim2.new(0,0,0,0)
otherworldText.Size = UDim2.new(0,200,0,50)
otherworldText.BackgroundTransparency = 1
function FogColor()
game.Lighting.FogColor = FogColor.Value
wait()
end
otherworldText.Text = "That's strange. It's getting darker."
otherworldText.Font = Enum.Font.SourceSansBold
otherworldText.FontSize = Enum.FontSize.Size36
otherworldText.TextColor = BrickColor.new(255,255,255)
otherworldText.TextStrokeTransparency = 0
for i = 0, 1, .1 do
otherworldText.TextTransparency = i
wait(0.1)
end
end
OtherworldPart.Touched:connect(onTouch)
EDIT: Posted the full script

1 comment
Is this the full script?