Hi, I am making a whole mechanism for a group game of mine I am facing the following issues below:
- The issues
I had my classLoadout GUI Enable properties off in the beginning and it works when I click play button from the main menu but does not seem to re-appear again when the player respawn.
- What I want to achieve
I want my classLoadout GUI re-appear again when the player respawns.
- Solutions
Seeking for help from DevForum.
Code source:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player.PlayerGui
local cam = workspace.CurrentCamera
local Controls = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")):GetControls()
local UserInputService = game:GetService("UserInputService")
script.Parent.MouseButton1Click:Connect(function()
--wait()
cam.CameraType = Enum.CameraType.Custom
cam.FieldOfView = 70
player.PlayerScripts:WaitForChild("MenuCameraLocalScript"):Destroy()
player.PlayerScripts:WaitForChild("CamFOV"):Destroy()
playerGui:WaitForChild("ScriptsGui"):Destroy()
--playerGui:WaitForChild("CameraRigScript"):Destroy()
--playerGui:WaitForChild("DDD"):Destroy()
--playerGui:WaitForChild("Language"):Destroy()
playerGui:WaitForChild("MenuGui"):Destroy()
playerGui:WaitForChild("PAKTCGui"):Destroy()
playerGui:WaitForChild("StudioLogo"):Destroy()
playerGui:WaitForChild("ClassGui").Enabled = true
Controls:Enable()
UserInputService.MouseDeltaSensitivity = 1
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
game.StarterGui:SetCore("ResetButtonCallback" ,true)
end)
P.S: The name of the gui is “ClassGui” and if you’re wondering that I enabled the ResetOnSpawn properties or not the answer is yes.