You can write your topic however you want, but you need to answer these questions:
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.
What is the issue? Include screenshots / videos if possible!
I know ScreenGui objects have a checkbox titled “ResetOnSpawn” that you can disable to keep everything functional. Maybe there’s something similar in SurfaceGui?
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.
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)