I got it to work with the same exact code (except I added a player variable) and no errors, RadioUI.rbxl (20.1 KB) there’s the place if you want to check it out.
local Lighting = game.Lighting
local Player = game.Players.LocalPlayer
Lighting.Ambient = Color3.fromRGB(10, 10, 10)
Lighting.SCP008Effect.Enabled = false
Lighting.SCP0492Effect.Enabled = false
Lighting.SCP059Effect.Enabled = false
Lighting.NightVision.Enabled = false
if game.Players.LocalPlayer.PlayerGui:FindFirstChild("Ambient") then
game.Players.LocalPlayer.PlayerGui:FindFirstChild("Ambient"):Destroy()
end
print("Spawn actions completed.")
wait(3)
if Player.Team ~= game.Teams["Class-D"] and Player.Team ~= game.Teams["Class-E"] and not Player.PlayerGui:FindFirstChild("Radio") and Player.PlayerGui:FindFirstChild("Menu").Music.Volume == 0 then
local RadioUI = game:GetService("ReplicatedStorage"):WaitForChild("Radio")
RadioUI:Clone()
-- RadioUI.Parent = Player.PlayerGui
-- RadioUI.Frame:TweenPosition(UDim2.new(1, -230, 1, -115),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.5)
if Player.Team == game.Teams["Chaos Insurgency"] then
RadioUI.Frame.Raid.Visible = true
else
RadioUI.Frame.Main.Visible = true
end
end
if not Player.PlayerGui:FindFirstChild("GunUI") then
local GunUI = game.ReplicatedStorage.GunUI:Clone()
GunUI.Parent = Player.PlayerGui
end
script:Destroy()
This is the whole script if that changes anything.