Ok Heres all the code that relevant.
Code for gui:
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Event = ReplicatedStorage:WaitForChild('LoadCharacter')
local EnableEvent = ReplicatedStorage:WaitForChild('EnableGui')
local target = workspace.Intro -- The object to rotate around
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.Focus = target.CFrame
local rotationAngle = Instance.new("NumberValue")
local tweenComplete = false
local player = game.Players.LocalPlayer
local cameraOffset = Vector3.new(50, 80, -50)
local rotationTime = 20 -- Time in seconds
local rotationDegrees = 360
local rotationRepeatCount = -1 -- Use -1 for infinite repeats
local lookAtTarget = true -- Whether the camera tilts to point directly at the target
local Play = script.Parent.Play
local Song = script.Parent.Nice
Play.MouseButton1Click:Connect(function()
Play:TweenPosition(UDim2.new(1.2,0,0.931,0), "Out", "Bounce", 1, false)
wait(1)
player.IntroTag.Value = false
Play:Destroy()
--EnableEvent:FireServer()
Event:FireServer()
wait(0.1)
target:Destroy()
camera:Destroy()
script.Parent:Destroy()
end)
Song:Play()
local function updateCamera()
local rotatedCFrame = CFrame.Angles(0, math.rad(rotationAngle.Value), 0)
camera.CFrame = rotatedCFrame:ToWorldSpace(CFrame.new(cameraOffset))
if lookAtTarget == true then
camera.CFrame = CFrame.new(camera.CFrame.Position, target.Position)
end
end
-- Set up and start rotation tween
local tweenInfo = TweenInfo.new(rotationTime, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, rotationRepeatCount)
local tween = TweenService:Create(rotationAngle, tweenInfo, {Value=rotationDegrees})
tween.Completed:Connect(function()
tweenComplete = true
end)
tween:Play()
-- Update camera position while tween runs
RunService.RenderStepped:Connect(function()
if tweenComplete == false then
updateCamera()
end
end)
This is Alot of Code.
AFK GUI Button
-- GetService and Other--
local UIS = game:GetService('UserInputService')
local epicblur = game.Lighting.Blur
local player = game.Players.LocalPlayer
-- Key Binds --
local AFKB = script.Parent.TextButton
local hotkeyController = Enum.KeyCode.ButtonR1
-- Text & Miscellaneous--
local Notice = script.Parent.AFK
AFKB.MouseButton1Click:Connect(function()
if AFKB.Text == 'AFK:OFF' then
player.AFK.Value = true
Notice.Visible = true
AFKB.Text = 'AFK:ON'
Notice:TweenPosition(UDim2.new(0.5,0,0.505,0), "Out", "Linear", 1)
print(player.Name..' AFK was Turned On.')
wait(0.5)
epicblur.Enabled = true
Notice.Text = 'AFK IN: 1'
wait(1)
Notice.Text = 'AFK IN: 2'
wait(1)
Notice.Text = 'AFK IN: 3'
wait(1)
Notice:TweenPosition(UDim2.new(1.5,0,0.505,0), "In", "Linear", 1)
epicblur.Enabled = false
Notice.Visible = not Notice.Visible
elseif AFKB.Text == 'AFK:ON' then
player.AFK.Value = false
Notice.Visible = true
AFKB.Text = 'AFK:OFF'
Notice:TweenPosition(UDim2.new(0.5,0,0.505,0), "In", "Linear", 1)
print(player.Name..' Is Now Back InGame.')
wait(0.5)
epicblur.Enabled = true
Notice.Text = 'AFK OFF: 3'
wait(1)
Notice.Text = 'AFK OFF: 2'
wait(1)
Notice.Text = 'AFK IN: 1'
wait(1)
Notice:TweenPosition(UDim2.new(1.5,0,0.505,0), "In", "Linear", 1)
epicblur.Enabled = false
Notice.Visible = not Notice.Visible
end
end)
--[[UIS.ImputBegan:Connect(function(key, gp)
if key.KeyCode == hotkeyController or key.KeyCode == bruh then
end
end)
--]]
Main Script
local plrs = {}
for i, player in pairs (game.Players:GetPlayers()) do
if (player.IntroTag.Value) or (player.AFK.Value) then
table.insert(plrs,player)--Add each players into plrs table
print(player)
--else
--warn(player, 'has Been Removed From Table - Intro Or AFK.')
--for i = 1, #plrs do
--if plrs[1] == Player then
--table.remove(plrs,i) --Remove Player from table if they are in the intro or AFK.
--[[ player.IntroTag.Changed:Connect(function(new_value)
if new_value == false then
print(player.Name.." 's New IntroTag Value:"..tostring(player.IntroTag.Value))
table.insert(plrs,player)
else
warn(player, 'has Been Removed From Table - Intro.')
table.remove(plrs,i)
end
end)
player.AFK.Changed:Connect(function(new_value)
if new_value == false then
print(player.Name.." 's New AFK Value:"..tostring(player.AFK.Value))
table.insert(plrs,player)
else
warn(player, 'has Been Removed From Table - AFK.')
table.remove(plrs,i)
end
end) --]]
end
end
Stats
game.Players.PlayerAdded:Connect(function(player)
playersLeft = playersLeft + 1
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local wins = Instance.new("IntValue")
wins.Name = "Wins"
wins.Value = 0
wins.Parent = leaderstats
local buxs = Instance.new("IntValue")
buxs.Name = "Buxs"
buxs.Value = 0
buxs.Parent = leaderstats
local kills = Instance.new("IntValue")
kills.Name = "Kills"
kills.Value = 0
kills.Parent = leaderstats
local xp = Instance.new("IntValue")
xp.Name = "XP"
xp.Value = 0
xp.Parent = leaderstats
--local lvl = Instance.new("IntValue")
--lvl.Name = "Level"
--lvl.Value = 0
--xp.Parent = player
--lvl.Parent = player
local IntroTag = Instance.new('BoolValue')
IntroTag.Name = 'IntroTag'
IntroTag.Value = true
IntroTag.Parent = player
local AFK = Instance.new('BoolValue')
AFK.Name = 'AFK'
AFK.Value = false
AFK.Parent = player
Hope this Helps…