--serverscript
local table = {
[1] = "Cowboi",
[2] = "Swordboi"
}
local replicatedstorage = game:GetService("ReplicatedStorage")
local event = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("ChooseEvent")
event.OnServerEvent:Connect(function(player:Player,scripts, page:IntValue, camera)
local char = player.Character
local charname = table[page.Value]
local boiscripts = replicatedstorage.CharacterScripts:FindFirstChild(charname.."Scripts")
local movementscripts = replicatedstorage.MovementScripts
local character = replicatedstorage.Characters:FindFirstChild(charname)
char:Destroy()
local newchar = character:Clone()
newchar.Name = player.Name
newchar.Parent = workspace
player.Character = newchar
player.Character:PivotTo(workspace:FindFirstChild("spawn here").CFrame)
local hrt = newchar:FindFirstChild("HumanoidRootPart")
event:FireClient(player, hrt)
for _, locscript in pairs(boiscripts:GetChildren()) do
local newscript = locscript:Clone()
newscript.Parent = scripts
--newscript.Enabled = true
end
for _, locscript in pairs(movementscripts:GetChildren()) do
local newscript = locscript:Clone()
newscript.Parent = scripts
--newscript.Enabled = true
end
end) it causes no errors in output btw
And also it deletes the gui and then it immediately reappears i know its cuz ResetOnSpawn but even when i disable it in server script or local it still reappears..?