Untitled

 avatar
unknown
lua
6 months ago
52 kB
2
Indexable
task.wait(5)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local MarketplaceService = game:GetService("MarketplaceService")
local TweenService = game:GetService("TweenService")
local SoundService = game:GetService("SoundService")
local Players = game:GetService("Players")
local BadgeService = game:GetService("BadgeService")
local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")
local CoreGui = game:GetService("StarterGui")

local Remotes = require(ReplicatedStorage:WaitForChild("Remotes"))
local Templates = ReplicatedStorage:WaitForChild("Templates")
local GameSettings = require(ReplicatedStorage:WaitForChild("GameSettings"))
local NumbersHelper = require(ReplicatedStorage:WaitForChild("Common"):WaitForChild("NumberHelpers"))
local ConfettiParticles = require(script.ConfettiParticles)

local Client = game.Players.LocalPlayer
local PlayerGui = Client.PlayerGui
local ScreenGui = PlayerGui.ScreenGui
local SPAWN_PART = game:GetService("Workspace").Map.SpawnPart

local ClaimedEvent = Remotes.Event("ClaimedEvent")
local UnclaimEvent = Remotes.Event("UnclaimedEvent")
local RefreshEvent = Remotes.Event("RefreshEvent")
local ChangeTextEvent = Remotes.Event("ChangeTextEvent")
local ChangeSignTextEvent = ReplicatedStorage:WaitForChild("Events"):WaitForChild("ChangeSignText")
local NotificationEvent = Remotes.Event("NotificationEvent")
local DonatedChanged = Remotes.Event("DonatedChanged")
local GetDonated = Remotes.Function("GetDonated")
local GetSpecialIds = Remotes.Function("GetSpecialIds")
local GetBooths = Remotes.Function("GetBooths")
local ChatDonationAlert = Remotes.Event("ChatDonationAlert")
local ChangeTheme = Remotes.Function("ChangeTheme")
local CreateVFXEvent = ReplicatedStorage:WaitForChild("CreateVFXEvent")
local CreateSFXFirework =  Remotes.Event("CreateSFXFirework")
local GetGiftBoothStuff = Remotes.Function("GetGiftBoothStuff")
local GetUnclaimedGifts = Remotes.Function("GetUnclaimedGifts")
local ClaimGifts = Remotes.Function("ClaimGifts")
local CreateVfxCoin = ReplicatedStorage:WaitForChild("Events"):WaitForChild("CreateVfxCoin")
local ChangeSignModel = ReplicatedStorage:WaitForChild("Events"):WaitForChild("ChangeSignModel")
local VFXLevels = ReplicatedStorage:WaitForChild("VFXLevels")

local OsClock = os.clock()


local donatedAmount = 0

donatedAmount = GetDonated:InvokeServer()
local CheckerImage = ScreenGui:WaitForChild("CheckerImage")
local CheckerDebounce = true
local Frames = {
	"EditBooth",
	"GiftPlayer",
	"Settings",
	"EditSign",
	"Gamepasses",
	"JoinGame",
	"AdsManager"
}

function NaturalTime(date)
	local dateTime = DateTime.now().UnixTimestamp - date.UnixTimestamp
	if dateTime < 10 then
		return "Just now"
	end
	if dateTime < 60 then
		return string.format("%i seconds ago", dateTime)
	end
	if dateTime < 120 then
		return "a minute ago"
	end
	if dateTime < 3600 then
		return string.format("%i minutes ago", dateTime / 60)
	end
	if dateTime < 7200 then
		return "an hour ago"
	end
	if dateTime < 86400 then
		return string.format("%i hours ago", dateTime / 3600)
	end
	return date:FormatLocalTime("LLL", Client.LocaleId)
end

function Tween(Object, Time, Data)
	TweenService:Create(Object, TweenInfo.new(Time, Enum.EasingStyle.Quint), Data):Play()
end

function popUp(text, typePopUp)
	if typePopUp == "error" then
		--PopupTemplate.TextColor3 = Color3.fromRGB(248, 38, 72)
		SoundService.Error:Play()
	elseif typePopUp == "normal" then
		--PopupTemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
		SoundService.Notification:Play()
	elseif typePopUp == "nice" then
		--PopupTemplate.TextColor3 = Color3.fromRGB(0, 189, 102)
		SoundService.Notification:Play()
	elseif typePopUp == "omg" then
		--PopupTemplate.TextColor3 = Color3.fromRGB(255, 255, 0)
		SoundService.Donation:Play()
	end

	CoreGui:SetCore("SendNotification", {
		Title = "New Notification!";
		Text = text;
		Duration = 2;
	})
end

function getRandomPositionInPart(Part)
	local x = Part.Position.X + math.random(-Part.Size.X/2,Part.Size.X/2)
	local y = Part.Position.Y + math.random(-Part.Size.Y/2,Part.Size.Y/2)
	local z = Part.Position.Z + math.random(-Part.Size.Z/2,Part.Size.Z/2)

	return Vector3.new(x,y,z)
end

function TweenChecker(dt)
	if CheckerDebounce == false then return end
	if game.Players.LocalPlayer:GetAttribute("Performance") == true then return end
	CheckerDebounce = false
	local TweenCheckerImage = TweenService:Create(CheckerImage, TweenInfo.new(25, Enum.EasingStyle.Linear), {Position = UDim2.new(0, 0, -1)})
	CheckerImage.Position = UDim2.new(-1)
	TweenCheckerImage:Play()
	TweenCheckerImage.Completed:Wait()
	CheckerDebounce = true
end

function ToggleCameraEffect(boolean)
	local _Size = 0
	local _FOV = 70
	if boolean then
		_Size = 25
		_FOV = 60
		TweenService:Create(CheckerImage, TweenInfo.new(0.1, Enum.EasingStyle.Linear), {ImageTransparency = 0.95}):Play()
	else
		TweenService:Create(CheckerImage, TweenInfo.new(0.1, Enum.EasingStyle.Linear), {ImageTransparency = 1}):Play()
	end
	TweenService:Create(
		game:GetService("Lighting").Blur, 
		TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
		{Size = _Size}
	):Play()
	TweenService:Create(
		game:GetService("Workspace").CurrentCamera, 
		TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
		{FieldOfView = _FOV}
	):Play()
end

function ChangeCameraMode(Scriptable : boolean)
	if Scriptable then
		repeat wait()
			game:GetService("Workspace").CurrentCamera.CameraType = Enum.CameraType.Scriptable
		until game:GetService("Workspace").CurrentCamera.CameraType == Enum.CameraType.Scriptable
	else
		repeat wait()
			game:GetService("Workspace").CurrentCamera.CameraType = Enum.CameraType.Custom
		until game:GetService("Workspace").CurrentCamera.CameraType == Enum.CameraType.Custom
	end
end

function ToggleFrame(FrameName)
	for _, Frame in pairs(ScreenGui:GetChildren()) do
		if Frame:IsA("Frame") and table.find(Frames, Frame.Name) and table.find(Frames, FrameName) then
			Frame.Visible = false
		end
	end
	--ScreenGui[FrameName].Position = UDim2.fromScale(0.55,0.55)
	--ScreenGui[FrameName].Size = UDim2.fromScale(0.35, 0.35)
	--ScreenGui[FrameName].Rotation = -5
	ScreenGui[FrameName].Visible = true
	--TweenService:Create(ScreenGui[FrameName],TweenInfo.new(0.1,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut),{Position = UDim2.new(0.34, 0,0.3, 0)}):Play()
	--TweenService:Create(ScreenGui[FrameName],TweenInfo.new(0.1,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut),{Size = UDim2.fromScale(0.4,0.4)}):Play()
	--TweenService:Create(ScreenGui[FrameName],TweenInfo.new(0.1,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut),{Rotation = 0}):Play()
end
--//START OF EDIT BOOTH GUI
local EditBoothFrame = ScreenGui.EditBooth
local EditBoothFrameThemes = EditBoothFrame.BoothThemes.Themes
local EditBoothTextBox = EditBoothFrame.BoothText.TextBox
local EditBoothPreviewPre = EditBoothFrame.Colors.ColorPicker.preview.pre
local EditBoothButton = ScreenGui.MenuButtons.EditBoothBG.EditBooth
local EditBoothStatisticsList = EditBoothFrame.Statistics.ScrollingFrame
local EditBoothStatisticsListTemplate = EditBoothStatisticsList.PlayerTemplate

local Debounce = false
local PlacedButtons = {
	"Template",
	"DefaultBooth",
	"100Donated",
	"1KDonated",
	"10KDonated",
	"100KDonated",
	"Developer",
	"Influencer",
	"FDCBooth",
	"VIPBooth"
}
local Connections = {

}

local function EditBoothFrameApplied()
	local filteredText =  tostring(EditBoothTextBox.Text)
	if string.len(filteredText) < 250 then
		ChangeTextEvent:FireServer(filteredText, EditBoothPreviewPre.BackgroundColor3)
		EditBoothFrame.Visible = false
		ToggleCameraEffect(false)
		spawn(function()
			popUp("changed", "normal")
		end)

	else
		spawn(function()
			popUp("max 250 char", "error")
		end)

	end
end

local function EditBoothFrameUnclaimed()
	EditBoothButton.Parent.Visible = false
	EditBoothFrame.Visible = false
	ToggleCameraEffect(false)
	UnclaimEvent:FireServer()
	script.YourBooth.Enabled = false
	script.YourBooth.Adornee = nil
	spawn(function()
		popUp("unclaimed", "error")
	end)
end

local function EditBoothButtonOpened()
	ToggleFrame("EditBooth")
	ToggleCameraEffect(true)
end

local function EditBoothFrameClosed()
	EditBoothFrame.Visible = false
	ToggleCameraEffect(false)
	spawn(function()
		popUp("canceled", "error")
	end)
end

local function LoadStatistics()
	--local TopDonatedStatistic = Remotes.Function("GetTopDonatedStatistic"):InvokeServer()
	--local succes, err = pcall(function()
	--	for i, position in pairs(TopDonatedStatistic) do
	--		local userID = tonumber(TopDonatedStatistic[i]["userId"])
	--		local robux = tostring(TopDonatedStatistic[i]["robux"])
	--		local TemplateFind = ScreenGui.BoothStatistics.LeaderboardDonated:FindFirstChild(TopDonatedStatistic[i]["userId"])
	--		if not TemplateFind then
	--			local Template = ScreenGui.BoothStatistics.LeaderboardDonated.PlayerTemplate:Clone()
	--			Template.Info.Username.Text = "@"..Players:GetNameFromUserIdAsync(userID)
	--			Template.Info.Avatar.Image = string.format("rbxthumb://type=AvatarHeadShot&id=%s&w=420&h=420", userID)
	--			Template.Stats.Robux.Text = NumbersHelper.formatCommas(robux) .. "\u{E002}"
	--			Template.Info.Rank.Text = "#"..i
	--			if i == 1 then
	--				Template.Info.Rank.TextColor3 = Color3.fromRGB(255, 213, 1)
	--			elseif i == 2 then
	--				Template.Info.Rank.TextColor3 = Color3.fromRGB(217, 217, 217)
	--			elseif i == 3 then
	--				Template.Info.Rank.TextColor3 = Color3.fromRGB(216, 137, 110)
	--			end
	--			Template.Visible = true
	--			Template.Name = tostring(userID)
	--			Template.Parent = ScreenGui.BoothStatistics.LeaderboardDonated
	--		else
	--			TemplateFind.Info.Username.Text = "@"..Players:GetNameFromUserIdAsync(userID)
	--			TemplateFind.Info.Avatar.Image = string.format("rbxthumb://type=AvatarHeadShot&id=%s&w=420&h=420", userID)
	--			TemplateFind.Stats.Robux.Text = NumbersHelper.formatCommas(robux) .. "\u{E002}"
	--			TemplateFind.Info.Rank.Text = "#"..i
	--			if i == 1 then
	--				TemplateFind.Info.Rank.TextColor3 = Color3.fromRGB(255, 213, 1)
	--			elseif i == 2 then
	--				TemplateFind.Info.Rank.TextColor3 = Color3.fromRGB(217, 217, 217)
	--			elseif i == 3 then
	--				TemplateFind.Info.Rank.TextColor3 = Color3.fromRGB(216, 137, 110)
	--			end
	--			TemplateFind.Visible = true
	--		end

	--	end
	--end)
	local TopReceivedStatistic = Remotes.Function("GetTopReceivedStatistic"):InvokeServer()
	local succes, err = pcall(function()
		for i, position in pairs(TopReceivedStatistic) do
			local userID = tonumber(TopReceivedStatistic[i]["userId"])
			local robux = tostring(TopReceivedStatistic[i]["robux"])
			local TemplateFind = EditBoothStatisticsList:FindFirstChild(TopReceivedStatistic[i]["userId"])
			if not TemplateFind then
				local Template = EditBoothStatisticsListTemplate:Clone()
				Template.Username.Text = "@"..Players:GetNameFromUserIdAsync(userID)
				--Template.Avatar.Image = string.format("rbxthumb://type=AvatarHeadShot&id=%s&w=420&h=420", userID)
				Template.Robux.Text = NumbersHelper.formatCommas(robux) .. "\u{E002}"
				Template.Rank.Text = "#"..i
				if i == 1 then
					Template.Rank.TextColor3 = Color3.fromRGB(255, 213, 1)
				elseif i == 2 then
					Template.Rank.TextColor3 = Color3.fromRGB(217, 217, 217)
				elseif i == 3 then
					Template.Rank.TextColor3 = Color3.fromRGB(216, 137, 110)
				end
				Template.Visible = true
				Template.Name = tostring(userID)
				Template.Parent = EditBoothStatisticsList
			else
				TemplateFind.Username.Text = "@"..Players:GetNameFromUserIdAsync(userID)
				--TemplateFind.Avatar.Image = string.format("rbxthumb://type=AvatarHeadShot&id=%s&w=420&h=420", userID)
				TemplateFind.Robux.Text = NumbersHelper.formatCommas(robux) .. "\u{E002}"
				TemplateFind.Rank.Text = "#"..i
				if i == 1 then
					TemplateFind.Rank.TextColor3 = Color3.fromRGB(255, 213, 1)
				elseif i == 2 then
					TemplateFind.Rank.TextColor3 = Color3.fromRGB(217, 217, 217)
				elseif i == 3 then
					TemplateFind.Rank.TextColor3 = Color3.fromRGB(216, 137, 110)
				end
				TemplateFind.Visible = true
			end

		end
	end)
	if err then
		warn(err)
	end
end

local function BoothButtonSetup(buttonName)
	if Debounce == true then return end
	Debounce = true
	donatedAmount = GetDonated:InvokeServer()
	if buttonName == "DefaultBooth" then
		local newBooth = ChangeTheme:InvokeServer("DefaultBooth")
		script.YourBooth.Adornee = newBooth.Interaction
	elseif buttonName == "100Donated" then
		if donatedAmount < 100 then
			popUp("u need 100\u{E002} donated", "error")
		else
			local newBooth = ChangeTheme:InvokeServer("GoldenBooth")
			script.YourBooth.Adornee = newBooth.Interaction
		end
	elseif buttonName == "1KDonated" then
		if donatedAmount < 1000 then
			popUp("u need 1K\u{E002} donated", "error")
		else
			local newBooth = ChangeTheme:InvokeServer("DiamondBooth")
			script.YourBooth.Adornee = newBooth.Interaction
		end
	elseif buttonName == "10KDonated" then
		if donatedAmount < 10000 then
			popUp("u need 10K\u{E002} donated", "error")
		else
			local newBooth = ChangeTheme:InvokeServer("EmeraldBooth")
			script.YourBooth.Adornee = newBooth.Interaction
		end
	elseif buttonName == "100KDonated" then
		if donatedAmount < 100000 then
			popUp("u need 100K\u{E002} donated", "error")
		else
			local newBooth = ChangeTheme:InvokeServer("RubyBooth")
			script.YourBooth.Adornee = newBooth.Interaction
		end
	elseif buttonName == "Influencer" then
		if GameSettings:GetRankInGroup(Client) == 25 or GameSettings:GetRankInGroup(Client) >= 253  then
			local newBooth = ChangeTheme:InvokeServer("InfluencerBooth")
			script.YourBooth.Adornee = newBooth.Interaction
		else
			popUp("ur not special...", "error")
		end
	elseif buttonName == "Developer" then
		if GameSettings:GetRankInGroup(Client) == 200 or GameSettings:GetRankInGroup(Client) >= 253 or GameSettings:GetRankInGroup(Client) >= 80 then
			local newBooth = ChangeTheme:InvokeServer("DeveloperBooth")
			script.YourBooth.Adornee = newBooth.Interaction
		else
			popUp("did you program any of this?", "error")
		end
	elseif buttonName == "FDCBooth" then
		if BadgeService:UserHasBadgeAsync(Client.UserId, 2141459311) then
			local newBooth = ChangeTheme:InvokeServer("FDCBooth")
			script.YourBooth.Adornee = newBooth.Interaction
		else
			popUp("achieve 'Skilled' in [🏆Fabi's Difficulty Chart]!", "error")
		end
	elseif buttonName == "VIPBooth" then
		if MarketplaceService:UserOwnsGamePassAsync(Client.UserId, GameSettings:GetGamepasses().VIP) then
			local newBooth = ChangeTheme:InvokeServer("VIPBooth")
			script.YourBooth.Adornee = newBooth.Interaction
		else
			popUp("you don't own the VIP Gamepass!", "error")
		end
	end
	task.wait(1)
	Debounce = false
end

local function SettingUpBoothButtons()
	for _, BoothButton in pairs(EditBoothFrameThemes:GetChildren()) do
		if BoothButton:IsA("TextButton") or BoothButton:IsA("ImageButton") and BoothButton.Name ~= "Template" then
			local buttonName = BoothButton.Name
			BoothButton.Activated:Connect(function()
				BoothButtonSetup(buttonName)
			end)
		end
	end
end

SettingUpBoothButtons()

local function Refresh()
	print("Starting Refresh function...")


	local rank = GameSettings:GetRankInGroup(Client)
	print("Client rank:", rank)

	EditBoothFrameThemes.Influencer.Visible = (rank == 25 or rank >= 253)
	print("Influencer visibility set to", EditBoothFrameThemes.Influencer.Visible)

	EditBoothFrameThemes.Developer.Visible = (rank == 200 or rank >= 253 or rank >= 80)
	print("Developer visibility set to", EditBoothFrameThemes.Developer.Visible)

	local hasBadge = BadgeService:UserHasBadgeAsync(Client.UserId, 2141459311)
	EditBoothFrameThemes.FDCBooth.Visible = hasBadge
	print("FDCBooth visibility set to", EditBoothFrameThemes.FDCBooth.Visible)


	print("PlacedButtons:", PlacedButtons)
	print("Type of PlacedButtons:", typeof(PlacedButtons))

	for _, Button in pairs(EditBoothFrameThemes:GetChildren()) do
		if Button:IsA("TextButton") then
			print("Checking Button:", Button.Name)

			if typeof(PlacedButtons) == "table" then
				if not table.find(PlacedButtons, Button.Name) then
					print("Destroying button:", Button.Name)
					Button:Destroy()
				end
			else
				print("Error: PlacedButtons is not a table")
			end
		end
	end


	print("Disconnecting existing connections...")
	for _, Connection in pairs(Connections) do
		if Connection then
			Connection:Disconnect()
			print("Disconnected connection.")
		end
	end


	print("Fetching Booth IDs from server...")
	local BoothIds = GetBooths:InvokeServer()
	print("Booth IDs fetched:", BoothIds)


	print("BoothIds:", BoothIds)
	print("Type of BoothIds:", typeof(BoothIds))


	print("Processing booths...")
	local booths = require(ReplicatedStorage:WaitForChild("Booths")).Booths
	if not booths then
		print("Error: No booths found.")
		return
	end

	for i, Booth in pairs(booths) do
		print("Processing Booth:", Booth.Id)
		print("Booth Text:", Booth.Text)
		print("Booth Image:", Booth.Image)
		print("Booth TextColor:", Booth.TextColor)
		print("Booth BackgroundColor:", Booth.BackgroundColor)

		if typeof(BoothIds) == "table" and table.find(BoothIds, Booth.Id) then
			print("Booth ID found in BoothIds:", Booth.Id)

			local Template = EditBoothFrameThemes.Template:Clone()
			Template.Name = Booth.Id
			Template.TextLabel.Text = Booth.Text
			Template.TextLabel.TextColor3 = Booth.TextColor
			Template.BackgroundColor3 = Booth.BackgroundColor
			Template.Parent = EditBoothFrameThemes
			Template.Visible = true
			Template.LayoutOrder = 9
			Template.Image = Booth.Image

			print("Template created with Name:", Template.Name)

			Connections[i] = Template.Activated:Connect(function()
				local newBooth = ChangeTheme:InvokeServer(Booth.Id)
				--print("New Booth Interaction:", newBooth.Interaction)
				script.YourBooth.Adornee = newBooth.Interaction
			end)
		else
			print("Booth ID not found in BoothIds:", Booth.Id)
		end
	end
	print("Booth processing completed.")
end


local function EditBoothFrameRefreshed()
	EditBoothFrame.Visible = false
	ToggleCameraEffect(false)
	RefreshEvent:FireServer(Client)
	spawn(function()
		popUp("refreshing...", "normal")
	end)
	Refresh()
	popUp("refreshed!", "normal")
	EditBoothFrame.Visible = true
end
--//END OF EDIT BOOTH GUI
--//START OF SETTINGS GUI
local SettingsFrame = ScreenGui.Settings
local SettingsFrameScrollingFrame = SettingsFrame.ScrollingFrame
local ChangeRemote = script.Parent.Anonymous.ChangeValueBoolean

local function Performance(ON)
	if ON then
		Client:SetAttribute("Performance", true)
		Lighting.ShadowSoftness = 0
		Lighting.GlobalShadows = false
		Lighting.Sky.StarCount = 0
		Lighting.Bloom.Size = 0
		Lighting.Bloom.Intensity = 0
	else
		Client:SetAttribute("Performance", false)
		Lighting.ShadowSoftness = 0.32
		Lighting.GlobalShadows = true
		Lighting.Sky.StarCount = 3000
		Lighting.Bloom.Size = 40
		Lighting.Bloom.Intensity = 1
	end
end

local function SettingsFrameOpened()
	ToggleFrame("Settings")
	ToggleCameraEffect(true)
end

local function SettingsFrameClosed()
	ToggleCameraEffect(false)
	SettingsFrame.Visible = false
	spawn(function()
		popUp("canceled", "error")
	end)
end

local function SettingsFrameApplied()
	SettingsFrame.Visible = false
	TweenService:Create(
		SoundService.MainGameSound,
		TweenInfo.new(0.5),
		{Volume = (SettingsFrameScrollingFrame.Music:GetAttribute("Value")/100)*2}):Play()
	TweenService:Create(
		SoundService.DonationSFX,
		TweenInfo.new(0.5),
		{Volume = (SettingsFrameScrollingFrame.DonationSFX:GetAttribute("Value")/100)*2}):Play()
	TweenService:Create(
		SoundService.OverallSFX,
		TweenInfo.new(0.5),
		{Volume = (SettingsFrameScrollingFrame.OverallSFX:GetAttribute("Value")/100)*2}):Play()
	TweenService:Create(
		game:GetService("Lighting"), 
		TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
		{ClockTime = (SettingsFrameScrollingFrame.DayTime:GetAttribute("Value")/100)*24}
	):Play()
	if SettingsFrameScrollingFrame.Performance:GetAttribute("Triggered") == true then
		Performance(true)
	else
		Performance(false)
	end
	ChangeRemote:FireServer(SettingsFrameScrollingFrame.Anonymous:GetAttribute("Triggered"))
	Remotes.Event("SetSettings"):FireServer({
		["MusicValue"] = SettingsFrameScrollingFrame.Music:GetAttribute("Value"),
		["DonationSFX"] = SettingsFrameScrollingFrame.DonationSFX:GetAttribute("Value"),
		["OverallSFX"] = SettingsFrameScrollingFrame.OverallSFX:GetAttribute("Value"),
		["DonationVFX"] = SettingsFrameScrollingFrame.DonationVFX:GetAttribute("Triggered"),
		["DayTime"] = SettingsFrameScrollingFrame.DayTime:GetAttribute("Value"),
		["Performance"] = SettingsFrameScrollingFrame.Performance:GetAttribute("Triggered"),
		["Anonymous"] = SettingsFrameScrollingFrame.Anonymous:GetAttribute("Triggered")
	})
	ToggleCameraEffect(false)
	spawn(function()
		popUp("applied!", "nice")
	end)
end

local function SettingUpSettings()
	local SettingsData = Remotes.Function("GetSettings"):InvokeServer()

	SettingsFrameScrollingFrame.Music:SetAttribute("Value", SettingsData.MusicValue)
	SettingsFrameScrollingFrame.DonationSFX:SetAttribute("Value", SettingsData.DonationSFX)
	SettingsFrameScrollingFrame.OverallSFX:SetAttribute("Value", SettingsData.OverallSFX)
	SettingsFrameScrollingFrame.DonationVFX:SetAttribute("Triggered",SettingsData.DonationVFX)
	SettingsFrameScrollingFrame.DayTime:SetAttribute("Value",SettingsData.DayTime)
	SettingsFrameScrollingFrame.Performance:SetAttribute("Triggered",SettingsData.Performance)
	SettingsFrameScrollingFrame.Anonymous:SetAttribute("Triggered",SettingsData.Anonymous)

	TweenService:Create(
		SoundService.MainGameSound,
		TweenInfo.new(0.5),
		{Volume = (SettingsFrameScrollingFrame.Music:GetAttribute("Value")/100)*2}
	):Play()
	TweenService:Create(
		SoundService.DonationSFX,
		TweenInfo.new(0.5),
		{Volume = (SettingsFrameScrollingFrame.DonationSFX:GetAttribute("Value")/100)*2}
	):Play()
	TweenService:Create(
		SoundService.OverallSFX,
		TweenInfo.new(0.5),
		{Volume = (SettingsFrameScrollingFrame.OverallSFX:GetAttribute("Value")/100)*2}
	):Play()
	TweenService:Create(
		game:GetService("Lighting"), 
		TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
		{ClockTime = (SettingsFrameScrollingFrame.DayTime:GetAttribute("Value")/100)*24}
	):Play()

	SettingsFrameScrollingFrame.Music.Slider.TextButton.Position = UDim2.new(SettingsFrameScrollingFrame.Music:GetAttribute("Value")/100,0,SettingsFrameScrollingFrame.Music.Slider.TextButton.Position.Y.Scale,0)
	SettingsFrameScrollingFrame.Music.AmountText.Text = (SettingsFrameScrollingFrame.Music:GetAttribute("Value")/100)*2

	SettingsFrameScrollingFrame.DayTime.Slider.TextButton.Position = UDim2.new(SettingsFrameScrollingFrame.DayTime:GetAttribute("Value")/100,0,SettingsFrameScrollingFrame.DayTime.Slider.TextButton.Position.Y.Scale,0)
	SettingsFrameScrollingFrame.DayTime.AmountText.Text = math.floor(((SettingsFrameScrollingFrame.DayTime:GetAttribute("Value")/100)*24))..":00"

	SettingsFrameScrollingFrame.DonationSFX.Slider.TextButton.Position = UDim2.new(SettingsFrameScrollingFrame.DonationSFX:GetAttribute("Value")/100,0,SettingsFrameScrollingFrame.DonationSFX.Slider.TextButton.Position.Y.Scale,0)
	SettingsFrameScrollingFrame.DonationSFX.AmountText.Text = (SettingsFrameScrollingFrame.DonationSFX:GetAttribute("Value")/100)*2

	SettingsFrameScrollingFrame.OverallSFX.Slider.TextButton.Position = UDim2.new(SettingsFrameScrollingFrame.OverallSFX:GetAttribute("Value")/100,0,SettingsFrameScrollingFrame.OverallSFX.Slider.TextButton.Position.Y.Scale,0)
	SettingsFrameScrollingFrame.OverallSFX.AmountText.Text = (SettingsFrameScrollingFrame.OverallSFX:GetAttribute("Value")/100)*2

	Client:SetAttribute("Performance", SettingsFrameScrollingFrame.Performance:GetAttribute("Triggered"))

	if SettingsFrameScrollingFrame.Performance:GetAttribute("Triggered") == true then
		Performance(true)
		TweenService:Create(
			game:GetService("Lighting"), 
			TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
			{ClockTime = 0}
		):Play()
		TweenService:Create(
			SettingsFrameScrollingFrame.Performance.Frame.ToggleFrame, 
			TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
			{BackgroundColor3 = Color3.new(0.4, 1, 0)}
		):Play()
		TweenService:Create(
			SettingsFrameScrollingFrame.Performance.Frame.ToggleFrame.Circle, 
			TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
			{Position = UDim2.fromScale(0.8,0.5)}
		):Play()
	end

	if SettingsFrameScrollingFrame.DonationVFX:GetAttribute("Triggered") == false then
		TweenService:Create(
			SettingsFrameScrollingFrame.DonationVFX.Frame.ToggleFrame, 
			TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
			{BackgroundColor3 = Color3.new(0.972549, 0.14902, 0.282353)}
		):Play()
		TweenService:Create(
			SettingsFrameScrollingFrame.DonationVFX.Frame.ToggleFrame.Circle, 
			TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
			{Position = UDim2.fromScale(0.2,0.5)}
		):Play()
	end

	if SettingsFrameScrollingFrame.Anonymous:GetAttribute("Triggered") == true then
		TweenService:Create(
			SettingsFrameScrollingFrame.Anonymous.Frame.ToggleFrame, 
			TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
			{BackgroundColor3 = Color3.new(0.4, 1, 0)}
		):Play()
		TweenService:Create(
			SettingsFrameScrollingFrame.Anonymous.Frame.ToggleFrame.Circle, 
			TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
			{Position = UDim2.fromScale(0.8,0.5)}
		):Play()
	end

	ChangeRemote:FireServer(SettingsFrameScrollingFrame.Anonymous:GetAttribute("Triggered"))

	for _, Setting in pairs(SettingsFrameScrollingFrame:GetChildren()) do
		if Setting:IsA("TextButton") and (Setting:GetAttribute("Triggered") == false or Setting:GetAttribute("Triggered") == true) then
			Setting.Activated:Connect(function()
				if Setting:GetAttribute("Triggered") == false then
					Setting:SetAttribute("Triggered", true)
					TweenService:Create(
						Setting.Frame.ToggleFrame, 
						TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
						{BackgroundColor3 = Color3.new(0, 0.741176, 0.4)}
					):Play()
					TweenService:Create(
						Setting.Frame.ToggleFrame.Circle, 
						TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
						{Position = UDim2.fromScale(0.8,0.5)}
					):Play()
				else
					Setting:SetAttribute("Triggered", false)
					TweenService:Create(
						Setting.Frame.ToggleFrame, 
						TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
						{BackgroundColor3 = Color3.new(0.972549, 0.14902, 0.282353)}
					):Play()
					TweenService:Create(
						Setting.Frame.ToggleFrame.Circle, 
						TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
						{Position = UDim2.fromScale(0.2,0.5)}
					):Play()
				end
			end)
		end
	end
end

SettingUpSettings()

--//END OF SETTINGS GUI
--//START OF GIFT GUI
local CurrentGiftModel 

local function ApplyDescription(UserId, Rig)
	local Description = game:GetService("Players"):GetHumanoidDescriptionFromUserId(UserId)
	Description.DepthScale = Description.DepthScale * 1
	Description.HeadScale = Description.HeadScale * 1
	Description.HeightScale = Description.HeightScale * 1
	Description.WidthScale = Description.WidthScale * 1 
	Rig.Humanoid:ApplyDescription(Description)
end

local function ChangeThemeGift(OldBooth, Booth, GiftModel)
	local newBooth = OldBooth:Clone()
	newBooth.Parent = GiftModel
	Booth.Info.Details.Parent = newBooth.Info
	Booth.Items.Items.Parent = newBooth.Items
	Booth.Text.Sign.Parent = newBooth.Text
	local newCFrame = Booth.PrimaryPart.CFrame
	Booth:SetPrimaryPartCFrame(game:GetService("Workspace").ORIGIN_PART.CFrame)
	newBooth:SetPrimaryPartCFrame(newCFrame)	
	Booth:Destroy()

	return newBooth
end

local function LoadGiftBooth(PlayerId, PlayerName, Message)
	local GiftModel = ReplicatedStorage:WaitForChild("Templates"):WaitForChild("GiftModel"):Clone()
	local HeadTag =  GiftModel.PlayerTemplate.Head.HeadTag
	HeadTag.Display.Text = PlayerName
	if table.find(GetSpecialIds:InvokeServer(), tonumber(PlayerId)) then
		HeadTag.Display.TextColor3 = Color3.new(1, 0.835294, 0.00392157)
	end
	local Booth, PlayercurrentBooth = GetGiftBoothStuff:InvokeServer(tonumber(PlayerId), tostring(PlayerName))
	GiftModel.DefaultBooth.Info.Details.Frame.OwnerLabel.Text = Booth.Info.Details.Frame.OwnerLabel.Text
	GiftModel.DefaultBooth.Text.Sign.Frame.SignLabel.Text = Booth.Text.Sign.Frame.SignLabel.Text
	GiftModel.DefaultBooth.Info.Details.Frame.MoneyRaised.Text = Booth.Info.Details.Frame.MoneyRaised.Text
	for _, Child in pairs(Booth.Items.Items.ScrollingFrame:GetChildren()) do
		Child:Clone().Parent = GiftModel.DefaultBooth.Items.Items.ScrollingFrame
	end
	ChangeThemeGift(ReplicatedStorage.BoothModels[PlayercurrentBooth], GiftModel.DefaultBooth, GiftModel)
	GiftModel.Parent = game:GetService("Workspace"):WaitForChild("Map")
	ApplyDescription(PlayerId, GiftModel.PlayerTemplate)
	ChangeCameraMode(true)
	ToggleCameraEffect(false)
	game:GetService("Workspace").CurrentCamera.CFrame = CFrame.lookAt(GiftModel.CameraPosition.Position, GiftModel.PlayerTemplate.Head.Position)
	ScreenGui.GiftPlayer.Visible = false
	ScreenGui.MenuButtons.Visible = false
	ScreenGui.CancelGifting.Visible = true
	CurrentGiftModel = GiftModel
end

local function CancelGiftingActivated()
	ScreenGui.MenuButtons.Visible = true
	ScreenGui.CancelGifting.Visible = false
	ChangeCameraMode(false)
	popUp("stopped gifting!", "nice")
	CurrentGiftModel:Destroy()
	CurrentGiftModel = nil
	local CurrentGiftModelChecker = game:GetService("Workspace"):WaitForChild("Map"):FindFirstChild("GiftModel")
	if CurrentGiftModelChecker then
		CurrentGiftModelChecker:Destroy()
	end
end

local function GiftPlayerApplied()
	local PlayerName = tostring(ScreenGui.GiftPlayer.GiftFrame.Username.Text)
	local PlayerId
	local success, response = pcall(function()
		PlayerId = Players:GetUserIdFromNameAsync(PlayerName)
	end)
	if PlayerId and success then
		popUp("loading...", "nice")
		LoadGiftBooth(PlayerId, PlayerName)
	else
		popUp("player '"..PlayerName.."' not found", "error")
	end
end

local function OpenGiftFrame()
	ToggleFrame("GiftPlayer")
	ToggleCameraEffect(true)
end

local function CloseGiftFrame()
	ScreenGui.GiftPlayer.Visible = false
	ToggleCameraEffect(false)
	popUp("canceled", "error")
end

local function CloseGiftsFrame()
	ToggleFrame("GiftPlayer")
end

local function TriggerGifts()
	ScreenGui.GiftPlayer.GiftFrame.Visible = not ScreenGui.GiftPlayer.GiftFrame.Visible
	ScreenGui.GiftPlayer.ScrollingFrame.Visible = not ScreenGui.GiftPlayer.ScrollingFrame.Visible
end


local Gifts, GiftCount = GetUnclaimedGifts:InvokeServer()
local function SettingUpGifts()

	if GiftCount > 0 then
		ScreenGui.MenuButtons.Buttons.Gift.Notification.Visible = true
		for _, Gift in pairs(Gifts) do
			local Template =ScreenGui.GiftPlayer.ScrollingFrame.Template:Clone()
			Template.Name = tostring(Gift.whenDonated)
			Template.Date.Text = NaturalTime(Gift.whenDonated)
			Template.Amount.Text = NumbersHelper.format(Gift.donatedRobux).."\u{E002}"
			Template.Avatar.Image = string.format("rbxthumb://type=AvatarHeadShot&id=%s&w=420&h=420", Gift.donator.Id)
			--Template.Message.Text = Gift.message
			Template.Username.Text = Gift.donator.DisplayName
			Template.Parent = ScreenGui.GiftPlayer.ScrollingFrame
			Template.Visible = true
		end
	end
end
SettingUpGifts()
print(GiftCount)
local function ClaimAllGifts()
	ScreenGui.MenuButtons.Buttons.Gift.Notification.Visible = false
	if GiftCount > 0  then
		GiftCount = 0
		Gifts = {}
		ClaimGifts:InvokeServer()
		for _, Gift in pairs(ScreenGui.GiftPlayer.ScrollingFrame:GetChildren()) do
			if Gift:IsA("Frame") and Gift.Name ~= "UIListLayout" and Gift.Name ~= "UIPadding" and Gift.Name ~= "Template" and Gift.Name ~= "Title" then
				Gift:Destroy()
			end
		end
		popUp("claimed gifts!", "nice")
	end

end

--//END OF GIFT GUI
--//START OF EDIT SIGN GUI
local EditSignFrame = ScreenGui.EditSign
local function EditSignActivated()
	ToggleCameraEffect(true)
	ToggleFrame("EditSign")
end
local function EditFrameClose()
	ToggleCameraEffect(false)
	ScreenGui.EditSign.Visible = false
end
local function EditSignApplied()
	ToggleCameraEffect(false)
	ScreenGui.EditSign.Visible = false
	local filteredText =  tostring(EditSignFrame.SignText.TextBox.Text)
	if string.len(filteredText) < 250 then
		ChangeSignTextEvent:FireServer(filteredText, EditSignFrame.Colors.ColorPicker.preview.pre.BackgroundColor3)
		ToggleCameraEffect(false)
		spawn(function()
			popUp("changed sign text!", "normal")
		end)
	else
		spawn(function()
			popUp("max 250 char", "error")
		end)
	end
end

local function SettingUpSignButtons(buttonName)
	donatedAmount = GetDonated:InvokeServer()
	if buttonName == "DefaultSign" then
		ChangeSignModel:FireServer("Sign0")
	elseif buttonName == "5KDonated" then
		if donatedAmount < 5000 then
			popUp("u need 5K\u{E002} donated", "error")
		else
			ChangeSignModel:FireServer("Sign5k")
		end
	elseif buttonName == "10KDonated" then
		if donatedAmount < 10000 then
			popUp("u need 10K\u{E002} donated", "error")
		else
			ChangeSignModel:FireServer("Sign10k")
		end
	elseif buttonName == "50KDonated" then
		if donatedAmount < 50000 then
			popUp("u need 50K\u{E002} donated", "error")
		else
			ChangeSignModel:FireServer("Sign50k")
		end
	elseif buttonName == "100KDonated" then
		if donatedAmount < 100000 then
			popUp("u need 100K\u{E002} donated", "error")
		else
			ChangeSignModel:FireServer("Sign100k")
		end
	end
end

local function LoadSignButtons()
	for _, SignButton in pairs(ScreenGui.EditSign.SignThemes.Themes:GetChildren()) do
		if SignButton:IsA("TextButton") or SignButton:IsA("ImageButton") and SignButton.Name ~= "Template" then
			local buttonName = SignButton.Name
			SignButton.Activated:Connect(function()
				SettingUpSignButtons(buttonName)
			end)
		end
	end
end

LoadSignButtons()

--//END OF EDIT SIGN GUI
--//START OF GAMEPASS GUI
local GamepassesFrame = ScreenGui.Gamepasses
local function GamepassesFrameOpen()
	ToggleCameraEffect(true)
	ToggleFrame("Gamepasses")
end

local function GamepassesFrameClose()
	ToggleCameraEffect(false)
	ScreenGui.Gamepasses.Visible = false
end

local GamepassesFrameGamepassesList = GamepassesFrame.ScrollingFrame
GamepassesFrameGamepassesList.Sign.Image.Image = "rbxthumb://type=GamePass&id="..GameSettings:GetGamepasses().Sign.."&w=150&h=150"
GamepassesFrameGamepassesList.Sign.Buy.PriceText.Text = MarketplaceService:GetProductInfo(GameSettings:GetGamepasses().Sign, Enum.InfoType.GamePass).PriceInRobux.."\u{E002}"
GamepassesFrameGamepassesList.Sign.Buy.Activated:Connect(function()
	MarketplaceService:PromptGamePassPurchase(Client, GameSettings:GetGamepasses().Sign)
end)

GamepassesFrame.PVS.Image.Image = "rbxthumb://type=GamePass&id="..GameSettings:GetGamepasses().PrivateServerPlus.."&w=150&h=150"
GamepassesFrame.PVS.Purchase.Text = MarketplaceService:GetProductInfo(GameSettings:GetGamepasses().PrivateServerPlus, Enum.InfoType.GamePass).PriceInRobux.."\u{E002}"
GamepassesFrame.PVS.Purchase.Activated:Connect(function()
	MarketplaceService:PromptGamePassPurchase(Client, GameSettings:GetGamepasses().PrivateServerPlus)
end)
GamepassesFrameGamepassesList.AnonymousDevice.Image.Image = "rbxthumb://type=GamePass&id="..GameSettings:GetGamepasses().AnonymousDevice.."&w=150&h=150"
GamepassesFrameGamepassesList.AnonymousDevice.Buy.PriceText.Text = MarketplaceService:GetProductInfo(GameSettings:GetGamepasses().AnonymousDevice, Enum.InfoType.GamePass).PriceInRobux.."\u{E002}"
GamepassesFrameGamepassesList.AnonymousDevice.Buy.Activated:Connect(function()
	MarketplaceService:PromptGamePassPurchase(Client, GameSettings:GetGamepasses().AnonymousDevice)
end)

GamepassesFrameGamepassesList.InvisibleDevice.Image.Image = "rbxthumb://type=GamePass&id="..GameSettings:GetGamepasses().InvisibleDevice.."&w=150&h=150"
GamepassesFrameGamepassesList.InvisibleDevice.Buy.PriceText.Text = MarketplaceService:GetProductInfo(GameSettings:GetGamepasses().InvisibleDevice, Enum.InfoType.GamePass).PriceInRobux.."\u{E002}"
GamepassesFrameGamepassesList.InvisibleDevice.Buy.Activated:Connect(function()
	MarketplaceService:PromptGamePassPurchase(Client, GameSettings:GetGamepasses().InvisibleDevice)
end)

GamepassesFrameGamepassesList.Vip.Image.Image = "rbxthumb://type=GamePass&id="..GameSettings:GetGamepasses().VIP.."&w=150&h=150"
GamepassesFrameGamepassesList.Vip.Buy.PriceText.Text = MarketplaceService:GetProductInfo(GameSettings:GetGamepasses().VIP, Enum.InfoType.GamePass).PriceInRobux.."\u{E002}"
GamepassesFrameGamepassesList.Vip.Buy.Activated:Connect(function()
	MarketplaceService:PromptGamePassPurchase(Client, GameSettings:GetGamepasses().VIP)
end)

GamepassesFrameGamepassesList.Kart.Image.Image = "rbxthumb://type=GamePass&id="..GameSettings:GetGamepasses().Kart.."&w=150&h=150"
GamepassesFrameGamepassesList.Kart.Buy.PriceText.Text = MarketplaceService:GetProductInfo(GameSettings:GetGamepasses().Kart, Enum.InfoType.GamePass).PriceInRobux.."\u{E002}"
GamepassesFrameGamepassesList.Kart.Buy.Activated:Connect(function()
	MarketplaceService:PromptGamePassPurchase(Client, GameSettings:GetGamepasses().Kart)
end)

--//END OF GAMEPASS GUI
--//START OF JOIN GAME
local function JoinGameClose()
	ScreenGui.JoinGame.Visible = false
	ToggleCameraEffect(false)
	spawn(function()
		popUp("canceled", "error")
	end)
end

local Connection
local function PromptGameEvent(gameName, gameId)
	if Connection then
		Connection:Disconnect()
	end
	ScreenGui.JoinGame.TextBox.Text = "You're about to join ["..gameName.."]. Are you sure?"
	ToggleFrame("JoinGame")
	ToggleCameraEffect(true)
	Connection = ScreenGui.JoinGame.Apply.Activated:Connect(function()
		spawn(function()
			popUp("teleporting...", "nice")
		end)
		pcall(function()
			game:GetService("TeleportService"):Teleport(tonumber(gameId))
		end)
	end)
end

--//END OF JOIN GAME
local function YourBooth()
	if script.YourBooth.Adornee then
		Client.Character:MoveTo((script.YourBooth.Adornee.CFrame * CFrame.new(0, 0, 4)).Position)
	end
end

local function CreateVFXEventFunction(Level, Part)
	if game.Players.LocalPlayer:GetAttribute("Performance") == true then return end
	spawn(function()
		local VFXs = { }
		for _, VFX in pairs(VFXLevels["Level"..Level]:GetChildren()) do
			if VFX.Name ~= "PingStar" and VFX.Name ~= "PingCircle" then
				local newVFX = VFX:Clone()
				newVFX.Parent = Part
				table.insert(VFXs,newVFX)
			end
		end
		if Level == 5 then
			local PingCircle = VFXLevels["Level"..Level].PingCircle:Clone()
			local PingStar = VFXLevels["Level"..Level].PingStar:Clone()
			PingCircle.Parent = Part
			PingStar.Parent = Part
			PingStar:Emit(1)
			PingCircle:Emit(1)
			SoundService.Ping:Play()
			SoundService.Fade:Play()
			spawn(function()
				task.wait(2)
				PingStar:Destroy()
				PingCircle:Destroy()
			end)
			task.wait(1.5)
		end
		for _, VFX in pairs(VFXs) do
			if VFX:IsA("ParticleEmitter") then
				if VFX:GetAttribute("EmitCount") then
					VFX:Emit(VFX:GetAttribute("EmitCount"))
				else
					VFX.Enabled = true
				end
			end
			if VFX:IsA("PointLight") then
				TweenService:Create(VFX, TweenInfo.new(GameSettings:GetLevelEmit(Level) + 15),{Brightness = 0}):Play()
			end
		end
		task.wait(GameSettings:GetLevelEmit(Level))
		for _, VFX in pairs(VFXs) do
			if VFX:IsA("ParticleEmitter") then
				VFX.Enabled = false
			end
		end
		task.wait(15)
		for _, VFX in pairs(VFXs) do
			VFX:Destroy()
		end
	end)
end

local function ChatAlert(gotDonateName, donatorName, amount, TYPEOF, color, err_)
	local Text
	if TYPEOF == "customError" then
		Text = err_
	elseif TYPEOF == "global" then
		Text = '[GLOBAL] <font color="#AAFF00">'.. gotDonateName ..'</font> donated <font color="%s">'..NumbersHelper.formatCommas(amount)..'\u{E002}</font> to <font color="#AAFF00">'..donatorName..'</font>'
	else
		Text = '[DONATION] <font color="#AAFF00">'.. gotDonateName ..'</font> gave <font color="%s">'..NumbersHelper.formatCommas(amount)..'\u{E002}</font> to <font color="#AAFF00">'..donatorName..'</font>'
	end
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = Text:format('#'..color:ToHex());
		Font = Enum.Font.GothamBold;
		Color = Color3.new(1, 1, 1);
		FontSize = Enum.FontSize.Size12;
	})
end

local function Notification(text, typePopUp, confetti)
	spawn(function()
		popUp(text, typePopUp)
	end)
	if confetti == true then
		ConfettiParticles.fire()
	end
end

local function CreateFireworks(Count)
	if game.Players.LocalPlayer:GetAttribute("Performance") == true then return end
	if workspace:GetRealPhysicsFPS() < 30 then return end
	GameSettings:CreateFireworks(Count, false)
end

local function CreateCoins(BoothBasePos, RaiserCharacter, RobuxAmount)
	if game.Players.LocalPlayer:GetAttribute("Performance") == true then return end
	local robuxCount, waitTime = GameSettings:GetCurrencyValues(RobuxAmount)
	local Color = GameSettings:GetLevelColors(GameSettings:GetLevel(RobuxAmount))
	local playbackSpeed = 0.5
	local coinBatchSize = math.floor(robuxCount * 0.11) 

	for i = 1, coinBatchSize do
		local Attachment = Instance.new("Attachment")
		Attachment.Name = "RobuxPosition"
		local success, error = pcall(function()
			Attachment.Parent = RaiserCharacter.HumanoidRootPart
		end)
		if not success then
			warn("Unable to find Humanoid (" .. error .. ")")
		end

		local RobuxCoin = Templates.RobuxCoin:Clone()
		RobuxCoin.Trail.Color = ColorSequence.new(Color3.new(1, 1, 1), Color)
		RobuxCoin.Center.Ring.Color = ColorSequence.new(Color3.new(1, 1, 1), Color)
		RobuxCoin.Center.Sparkles.Color = ColorSequence.new(Color, Color3.new(1, 1, 1), Color)
		RobuxCoin.Center.Glow.Color = Color
		RobuxCoin.Color = Color
		RobuxCoin.Position = BoothBasePos
		RobuxCoin.AlignPosition.Position = RobuxCoin.Position + Vector3.new(math.random(-15, 15), math.random(15, 25), math.random(-15, 15))
		RobuxCoin.Spin.AngularVelocity = Vector3.new(0, math.random(150, 250) / 10, 0)
		RobuxCoin.Size = Vector3.new(0, 0, 0)
		RobuxCoin.Parent = game:GetService("Workspace")

		TweenService:Create(RobuxCoin, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = Vector3.new(2.758, 0.375, 3)}):Play()
		TweenService:Create(RobuxCoin.Center.Glow, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Brightness = 0.5}):Play()

		local effectOn = false
		local function CoinEffect()
			if effectOn then return end
			effectOn = true

			RobuxCoin.Trail.Enabled = false
			RobuxCoin.AlignPosition.MaxVelocity = 0
			RobuxCoin.AlignPosition.Responsiveness = 200
			RobuxCoin.AlignPosition.Mode = Enum.PositionAlignmentMode.OneAttachment
			RobuxCoin.AlignPosition.Attachment0 = RobuxCoin.Center
			RobuxCoin.AlignPosition.Position = RobuxCoin.Position

			TweenService:Create(RobuxCoin.Center.Glow, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Brightness = 0, Range = 5}):Play()
			TweenService:Create(RobuxCoin, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = Vector3.new(0, 0, 0)}):Play()
			task.wait(1)
			RobuxCoin:Destroy()
			Attachment:Destroy()
		end

		local function TriggerCoinEffect()
			if not Attachment:IsDescendantOf(game) then
				CoinEffect()
			elseif (RobuxCoin.Center.WorldPosition - Attachment.WorldPosition).Magnitude < 2.5 then
				CoinEffect()
			end
		end

		spawn(function()
			task.wait(1)
			local connection = game:GetService("RunService").Heartbeat:Connect(TriggerCoinEffect)
			RobuxCoin.Trail.Enabled = true
			RobuxCoin.AlignPosition.MaxVelocity = 1
			RobuxCoin.AlignPosition.Responsiveness = 100
			RobuxCoin.AlignPosition.Mode = Enum.PositionAlignmentMode.TwoAttachment
			RobuxCoin.AlignPosition.Attachment1 = Attachment

			TweenService:Create(RobuxCoin.AlignPosition, TweenInfo.new(math.random(350, 450) / 100, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {MaxVelocity = 150}):Play()
			task.wait(10)
			if not effectOn then
				Attachment:Destroy()
			end
			connection:Disconnect()
		end)

		task.wait(waitTime / 5) -- Adjust wait time for performance
	end
end


local function ClaimedEventFunction(Interaction)
	Refresh()
	spawn(function()
		SoundService.ClaimBooth:Play()
		popUp("claimed", "nice")
	end)

	ScreenGui.MenuButtons.EditBoothBG.Visible = true
	if Interaction then
		script.YourBooth.Adornee = Interaction
		script.YourBooth.Enabled = true
	end
end

local function RefreshEventFunction(refreshType)
	if refreshType == "boothButtons" then
		Refresh()
	end
end

--//EVENTS

--//ADS MANAGER
--if Client.UserId == GameSettings:GetFabiUserIds() then
--	local Connections = { }
--	local AdsList = ScreenGui.AdsManager.AdsList
--	local Template = AdsList.AdTemplate
--	local function RefreshAdList()
--		task.wait(2)
--		for _, Connection in pairs(Connections) do
--			if Connection then
--				Connection:Disconnect()
--			end
--		end
--		for _, Frame in pairs(AdsList:GetChildren()) do
--			if Frame:IsA("Frame") and Frame.Name ~= "AdTemplate" then
--				Frame:Destroy()
--			end
--		end
--		local Ads = Remotes.Function("GetAds"):InvokeServer()
--		if #Ads == 0 then return end
--		for i, Ad in pairs(Ads) do
--			local AdTemplate = Template:Clone()
--			AdTemplate.IconFrame.Cover.Image = "rbxassetid://"..MarketplaceService:GetProductInfo(Ad.GameId).IconImageAssetId
--			AdTemplate.Info.GameId.Text = Ad.GameId
--			AdTemplate.Info.GameName.Text  = Ad.GameName
--			AdTemplate.Info.GameTextOnAd.Text  = Ad.GameText
--			local DateInfo = os.date("!*t", Ad.Expires)
--			AdTemplate.Stats.Time.Text = DateInfo["day"].."/"..DateInfo["month"].."/"..DateInfo["year"].." \n"..DateInfo["hour"]..":"..DateInfo["min"]
--			Connections[i] = AdTemplate.Stats.RemoveButton.Activated:Connect(function()
--				Remotes.Function("RemoveAd"):InvokeServer(Ad.GameId)
--				popUp("removed ad!", "nice")
--				RefreshAdList()
--			end)
--			AdTemplate.Name = Ad.GameName
--			AdTemplate.Parent = AdsList
--			AdTemplate.Visible = true
--		end
--	end

--	ScreenGui.Buttons.AdsManager.Visible = true
--	ScreenGui.Buttons.AdsManager.Activated:Connect(function()
--		ToggleFrame("AdsManager")
--		ToggleCameraEffect(true)
--	end)
--	ScreenGui.AdsManager.Buttons.Close.Activated:Connect(function()
--		ScreenGui.AdsManager.Visible = false
--		ToggleCameraEffect(false)
--		spawn(function()
--			popUp("canceled", "error")
--		end)
--	end)
--	ScreenGui.AdsManager.Apply.Activated:Connect(function()
--		local Data = {
--			["GameId"] = ScreenGui.AdsManager.GameIdBox.Text,
--			["GameName"] =  ScreenGui.AdsManager.GameNameBox.Text,
--			["GameText"] =  ScreenGui.AdsManager.GameTextBox.Text,
--			["Expires"] = ScreenGui.AdsManager.GameExpireBox.Text
--		}
--		Remotes.Function("AddAd"):InvokeServer(Data)
--		RefreshAdList()
--		popUp("added ad!", "nice")
--	end)
--	ScreenGui.AdsManager.Buttons.Refresh.Activated:Connect(function()
--		RefreshAdList()
--	end)
--	RefreshAdList()
--end
local function LoadAllButtonsSounds()
	for _, Button in pairs(ScreenGui:GetDescendants()) do
		if Button:IsA("TextButton") or Button:IsA("ImageButton") then
			Button.MouseEnter:Connect(function()
				SoundService.Hover1:Play()
			end)
			Button.MouseLeave:Connect(function()
				SoundService.Hover2:Play()
			end)
			Button.Activated:Connect(function()
				SoundService.Click:Play()
			end)
		end
	end
end

LoadAllButtonsSounds()
--// CONNECTIONS

--// IF MOBILE THEN TOUCH OTHERWISE MOUSEBUTTON1
RunService.Heartbeat:Connect(TweenChecker)

EditBoothFrame.Apply.Activated:Connect(EditBoothFrameApplied)
EditBoothFrame.Unclaim.Activated:Connect(EditBoothFrameUnclaimed)
ScreenGui.MenuButtons.EditBoothBG.EditBooth.Activated:Connect(EditBoothButtonOpened)
EditBoothFrame.Buttons.Close.Activated:Connect(EditBoothFrameClosed)
EditBoothFrame.Statistics.LoadButton.Activated:Connect(LoadStatistics)
EditBoothFrame.Buttons.Refresh.Activated:Connect(EditBoothFrameRefreshed)

ScreenGui.MenuButtons.Buttons.Settings.Activated:Connect(SettingsFrameOpened)
SettingsFrame.Buttons.Close.Activated:Connect(SettingsFrameClosed)
SettingsFrame.Apply.Activated:Connect(SettingsFrameApplied)

ScreenGui.CancelGifting.Activated:Connect(CancelGiftingActivated)
ScreenGui.GiftPlayer.GiftFrame.Apply.Activated:Connect(GiftPlayerApplied)
ScreenGui.MenuButtons.Buttons.Gift.Activated:Connect(OpenGiftFrame)
ScreenGui.GiftPlayer.Buttons.Close.Activated:Connect(CloseGiftFrame)
ScreenGui.GiftPlayer.Gifts.Button.Activated:Connect(TriggerGifts)
ScreenGui.GiftPlayer.Aknowledge.Activated:Connect(ClaimAllGifts)

ScreenGui.MenuButtons.EditSignBG.EditSign.Activated:Connect(EditSignActivated)
ScreenGui.EditSign.Buttons.Close.Activated:Connect(EditFrameClose)
ScreenGui.EditSign.Apply.Activated:Connect(EditSignApplied)

ScreenGui.MenuButtons.Buttons.Gamepasses.Activated:Connect(GamepassesFrameOpen)
GamepassesFrame.Buttons.Close.Activated:Connect(GamepassesFrameClose)

ScreenGui.JoinGame.Buttons.Close.Activated:Connect(JoinGameClose)
script.YourBooth.TextLabel.Button.Activated:Connect(YourBooth)

ReplicatedStorage:WaitForChild("Events"):WaitForChild("PromptGame").OnClientEvent:Connect(function(gameName, gameId)
	PromptGameEvent(gameName, gameId)
end)
CreateVFXEvent.OnClientEvent:Connect(function(Level, Part)
	CreateVFXEventFunction(Level, Part)
end)
ChatDonationAlert.OnClientEvent:Connect(function(gotDonateName, donatorName, amount, TYPEOF, color, err_)
	ChatAlert(gotDonateName, donatorName, amount, TYPEOF, color, err_)
end)
NotificationEvent.OnClientEvent:Connect(function(text, typePopUp, confetti)
	Notification(text, typePopUp, confetti)
end)
CreateSFXFirework.OnClientEvent:Connect(function(Count)
	CreateFireworks(Count)
end)
CreateVfxCoin.OnClientEvent:Connect(function(BoothBasePos, RaiserCharacter, RobuxAmount)
	CreateCoins(BoothBasePos, RaiserCharacter, RobuxAmount)
end)
ClaimedEvent.OnClientEvent:Connect(function(Interaction)
	ClaimedEventFunction(Interaction)

end)
RefreshEvent.OnClientEvent:Connect(function(refreshType)
	RefreshEventFunction(refreshType)	
end)

print(string.format("Client MAIN LOCAL SCRIPT loaded in %i ms", (os.clock() - OsClock) * 1000))
Editor is loading...
Leave a Comment