#My menu is appearing again when I die
1 messages · Page 1 of 1 (latest)
local ts = game:GetService("TweenService")
local plr = game.Players.LocalPlayer
local char = plr.Character
local currentCamera = game.Workspace.CurrentCamera
local coolDown = "99999999999999999999999999"
currentCamera.CameraType = Enum.CameraType.Scriptable
local cameras = game.Workspace:WaitForChild("CameraMenu")
char.Humanoid.WalkSpeed = 0
char.Humanoid.JumpPower = 0
local MenuAsset = script.Parent:WaitForChild("MenuAsset")
local playButton = MenuAsset:WaitForChild("Play")
local customizeButton = MenuAsset:WaitForChild("Customize")
local settingsButton = MenuAsset:WaitForChild("Settings")
local updatesButton = MenuAsset:WaitForChild("Updates")
MenuAsset.Bf.BackgroundTransparency = 0
currentCamera.CameraType = Enum.CameraType.Scriptable
currentCamera.CFrame = cameras:WaitForChild("Startpos").CFrame
task.wait(2)
ts:Create(MenuAsset.Bf,TweenInfo.new(1),{BackgroundTransparency = 0.3}):Play()
ts:Create(currentCamera,TweenInfo.new(4.2),{CFrame = cameras.Endpos.CFrame}):Play()
task.wait(2.7)
for i,v in MenuAsset:GetChildren() do
if v:IsA("ImageButton") then
ts:Create(v,TweenInfo.new(0.7),{ImageTransparency = 0}):Play()
end
if v:IsA("ImageLabel") then
ts:Create(v,TweenInfo.new(0.7),{ImageTransparency = 0}):Play()
end
end
playButton.MouseButton1Click:Connect(function()
ts:Create(MenuAsset.Play,TweenInfo.new(1),{ImageTransparency = 1}):Play()
ts:Create(MenuAsset.Customize,TweenInfo.new(1),{ImageTransparency = 1}):Play()
Is the script that enables the menu inside startercharacterscripts?
** You are now Level 1! **
ts:Create(MenuAsset.Settings,TweenInfo.new(1),{ImageTransparency = 1}):Play()
ts:Create(MenuAsset.Updates,TweenInfo.new(1),{ImageTransparency = 1}):Play()
ts:Create(MenuAsset.Title,TweenInfo.new(1),{ImageTransparency = 1}):Play()
ts:Create(MenuAsset.Title2,TweenInfo.new(1),{ImageTransparency = 1}):Play()
ts:Create(MenuAsset.Bf,TweenInfo.new(1),{BackgroundTransparency = 0}):Play()
task.wait(1)
ts:Create(MenuAsset.Bf,TweenInfo.new(1),{BackgroundTransparency = 1}):Play()
char.HumanoidRootPart.CFrame = game.Workspace.afterMenuPos.CFrame
char.Humanoid.WalkSpeed = 16
char.Humanoid.JumpPower = 50
currentCamera.CameraType = Enum.CameraType.Custom
task.wait(coolDown)
end)
it's in the startergui
I just made the menu with my limited knowledge since I've been only in roblox studio for a week now so
** You are now Level 2! **
Hmm if you have ResetOnSpawn enabled then I don’t see why you would have this problem your code seems fine
I also tried disabling the script after they hit play but it also doesn't work
so I just removed it
the script and the screen gui
nvm I haven't but it still doesn't work
local plr = game.Players.LocalPlayer
local char = plr.Character
if char.Humanoid.Health == 0 then
script.Parent.menuHandler.Enabled = false
end
char.Humanoid.Died:Connect(function()
script.Parent.menuHandler.Enabled = false
end)
I made it so if the player dies the menu script will disable
but still even countless reset it still doesn't work
I feel like within this context it’d probably be better to parent the scripts to your guis every time you respawn the scripts are running again as they are cloned to your players scripts
I'll try to recreate the script and put it within the MenuAsset
Yea I’m almost positive that will fix your issue
Valid but it should be a pretty simple fix all your are doing is changing how the guis are accessed local gui = script.BlahBlah
Amazing.
Np I’m glad you figured it out
it wasn't working yesterday so I gave up
but then I looked at it again
and added this
It be like that once you have a fresh perspective you realize how simple what you needed to do actually was
It just gets frustrating once you start having trouble and your tired and you just wanna be done
I thought I couldn't do that but then I tried then it works fine
yea fr ngl I almost gave up yesterday but I remembered learning takes months and literally never ending trial and error
Yea I actually forgot to include that in my line gui = script.Parent.blahblah
are you also making a game?
Just keep going at it and you’ll be unstoppable
I wouldn’t say making right now I’m kinda just in the process of learning until I eventually settle on a game to make
I just make concepts/frameworks for practice
how long have you been learning?
I mean I’ve been scripting for years now but not actively just something I recently started to seriously get into
** You are now Level 2! **
So maybe like 3 months of scripting knowledge or sum
I see, check dm
U fixed it?
I have the same problem and I'm very frustrated
I can't get the guis to not reactivate when I die
xD
lemme think
lemme recall
oh
what I did is I fixed the script
I added ".Parent" to a line
and it was fixed
may I see your script
** You are now Level 3! **
HAHAHA I'm going to go crazy, I swear.
** You are now Level 1! **
lemme see it
I just solved it
you just have to understand what you're doing and you're good
It was this setting
oh
xD
yea that works too
so your script was inside the screenGui I suppose
yea
this only works when your script is inside it
I assume it is
mine was outside so that didn't work on me
The problem with my script is that it is split
I have a main menu and a cinematic that is skipped with a button.
The button part of the cinematic is in StarterPlayerScripts but the rest of the gui is in StarterGui
oh yea