Hi, so Im currently working on a Admin/Money System.
Everything works fine UNTIL I respawn the character. I tried now everything I could imagine. ResetOnSpawn is not changing anything. I put the LocalMainScript intoi StarterPlayerScripts (which made the menu open but interactions still dont work). I tried to copy the old ui on death into the playergui. But nothing worked.
-- ServerScript:
game.Players.PlayerAdded:Connect(function(plr)
wait(2)
Update()
plr.Character.Humanoid.Died:Connect(function()
local UI = plr.PlayerGui["Money/AdminSG"]:Clone()
wait(game.Players.RespawnTime + 1)
Update()
UI.Parent = plr.PlayerGui
end)
end)
function Update()
rep.ModuleEvent:FireAllClients(Module.Whitelist, Module.Supporter, Module.Moderator, Module.Unlimited)
end
--LocalScript inside StarterPlayerScripts:
wait(1)
local UIS = game:GetService("UserInputService")
local repSto = game:GetService("ReplicatedStorage")
local rep = repSto:FindFirstChild("Money/AdminRS")
open = false
visible = false
local Unlimited = nil
local Moderator = nil
local Supporter = nil
local LocalPlayer = game.Players.LocalPlayer
local UI = LocalPlayer.PlayerGui["Money/AdminSG"].AdminPanel
local sound = UI.Denied
local Menu = UI.Menu
local MoneyMenu = UI.Money
local KickMenu = UI.Kick
local TeleportMenu = UI.Teleport
local BanMenu = UI.Ban
local SuperMenu = UI.SuperMenu
local Announcement = UI.Announcement
local Permissions = UI.Permissions
rep.ModuleEvent.OnClientEvent:Connect(function(White, Sup, Mod, UnLim)
print(Sup)
Supporter = Sup
Moderator = Mod
Unlimited = UnLim
LocalPlayer = game.Players.LocalPlayer
UI = LocalPlayer.PlayerGui["Money/AdminSG"].AdminPanel
sound = UI.Denied
Menu = UI.Menu
MoneyMenu = UI.Money
KickMenu = UI.Kick
TeleportMenu = UI.Teleport
BanMenu = UI.Ban
SuperMenu = UI.SuperMenu
Announcement = UI.Announcement
Permissions = UI.Permissions
end)
UI.Parent.Money.Frame.Visible = true
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.F and not gameProcessedEvent then
print("doubled")
if table.find(Unlimited, LocalPlayer.Name) or table.find(Moderator, LocalPlayer.Name) or table.find(Supporter, LocalPlayer.Name) then
print("good")
if open == false then
open = true
Menu.Visible = true
if table.find(Unlimited, LocalPlayer.Name) then
SuperMenu.Visible = true
end
elseif Menu.Visible == true then
open = false
Menu.Visible = false
SuperMenu.Visible = false
Announcement.Visible = false
end
end
end
end)
Menu.MoneyButton.MouseButton1Click:Connect(function()
print("yes")
if table.find(Unlimited, LocalPlayer.Name) then
Menu.Visible = false
SuperMenu.Visible = false
MoneyMenu.Visible = true
else
Menu.MoneyButton.Text = "NOT HIGH ENOUGH RANK"
sound:Play()
wait(3)
Menu.MoneyButton.Text = "Money"
end
end)
After the respawn, the menu opens but I cant open further menus like the money menu.
The menu has now ResetOnSpawn on but like I said, its not making any difference.