When you reset yourself, UI breaks

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    So I have an ordering system where I have these tills that use a UI. This UI is done from a SurfaceGUI externally, in a folder which is binded through the adornee option. So I got a button on there that says “create order” and if I reset my character, that button stops working, and wont bring up my ui. Why is it done externally? Because the order board shows what till number it was ordered from.

  2. What is the issue? Include screenshots / videos if possible!

    Screenshot_45

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Nothing so far, since I haven’t found anything useful.

Script: Nothing yet, will post if needed.

1 Like

I know ScreenGui objects have a checkbox titled “ResetOnSpawn” that you can disable to keep everything functional. Maybe there’s something similar in SurfaceGui?

1 Like

Yes, just checked and that property does exist on SurfaceGuis.

1 Like

Oh yea! Let me try. I will update you guys.

Didn’t fix it. ;-; This is confusing, it should be working.

Could you show the script used to determine the button’s functionality?

Sure.

script.Parent.MouseButton1Click:Connect(function()
	local ranking = script.Parent.Parent.Parent.Parent.GroupId
	local role = script.Parent.Parent.Parent.Parent.RankMinimum
	if script.Parent.Parent.Parent.Parent.OpenMenu.Value == 'true' and game.Players.LocalPlayer:GetRankInGroup(ranking.Value) >= role.Value then
	local player = game.Players.LocalPlayer
	script.Parent.Parent.Parent.Parent.Parent.MenuList.Frame.Visible = true
	script.Parent.Parent.Parent.Parent.Parent.MenuList.Frame:TweenPosition(UDim2.new(0.205, 0, 0.25, 0),"Out", "Linear",1.0,true)
	script.Parent.Parent.Parent.Parent.Parent.MenuList.Frame.TableNum.Value = script.Parent.Parent.Parent.Name
	end
end)

Apologies for this not exactly being on topic to the main question. I don’t have any solution for that yet.

What I can say is that checking if the player has the required rank to operate anything from a client is a giant security risk. An exploit can easily bypass that, especially if you post code on the DevForum for help. They lurk here. Joke aside, consider doing a server check when the player enters the game to see if the interface at all should be accessible to them. You can rerun this check whenever they reset, die or respawn from any means in case of someone getting their rank changed whilst still being in that same session.

1 Like

Okay so I tried making the surfacegui into the screen and had to rescript button, now the button is clickable when you reset but it won’t bring the ui up. Must be problem with script.

Here’s the button script:

script.Parent.MouseButton1Click:Connect(function()
	local player = game.Players.LocalPlayer
	local ranking = game.SurfaceGui.Tablets.GroupId
	local role = game.SurfaceGui.Tablets.RankMinimum
	local OrderFrame = game.SurfaceGui.MenuList.Frame
	local OpenMenu = game.SurfaceGui.Tablets.OpenMenu
	if OpenMenu.Value == 'true' and game.Players.LocalPlayer:GetRankInGroup(ranking.Value) >= role.Value then
		OrderFrame.Visible = true
		OrderFrame:TweenPosition(UDim2.new(0.205, 0, 0.25, 0),"Out", "Linear",1.0,true)
	end
end)

Any possible fixes or nah? May be a ROBLOX bug too for everyone.

Are the SurfaceGuis located in StarterGui, and are they added through a script or are they there beforehand?

They are in a folder in startergui and binded to a screen on the surfacegui options.

Try putting the script that binds and handles their logic in StarterGui. (If it isn’t already in StarterGui)