How would I make it so instead of resetting the character it shows a UI element when the reset character (respawn) is clicked
1 Like
ResetButtonCallback. Pass it a bindable event.
1 Like
Ok. How would I do that? (30 chars)
1 Like
Yes, I did read it. I dont understand it.
1 Like
In the future, just look at the example code on the article.
--localscript
local StarterGui = game:GetService("StarterGui")
local ResetBindable = Instance.new("BindableEvent")
local function setCallback()
StarterGui:SetCore("ResetButtonCallback", ResetBindable)
end
local success = false
local retryCount = 0
local maxTries = 5
repeat
success = pcall(setCallback)
retryCount = retryCount + 1
until success or retryCount >= maxTries
ResetBindable.Event:Connect(function()
-- the player reset
end)
2 Likes