Hello, I am struggling to find a resource for this idea, and I think I have to make my own
What do you want to achieve? I want to have a gui that teleports you somewhere, and reappears every 3 minutes, not since you clicked it, but every 5 mniutes, it also has to disappear after you click it
What is the issue? I get an error that the part isnt in workspace, but it is, and, I dont have the reappear aspect in the script
What solutions have you tried so far? I looked in roblox studio for free models, I couldnt find anything
local part = workspace.TeleportPart -- Name of my part
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local humanoidrootpart = plr.Character:FindFirstChild("HumanoidRootPart")
if humanoidrootpart then
humanoidrootpart.CFrame = CFrame.new(part.CFrame.p) + Vector3.new(0,5,0)
end
end)
First of all you said: CFrame.new(part.CFrame.p) Which CFrame.p means getting the position. Which you don’t need just say:
local part = workspace.TeleportPart -- Name of my part
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local humanoidrootpart = plr.Character:FindFirstChild("HumanoidRootPart")
if humanoidrootpart then
humanoidrootpart.CFrame = part.CFrame + Vector3.new(0,5,0)
end
end)
Also, how I would do it is make a serversided debounce (cooldown) and instead of doing this all in a local script just fire to the server. Then, check if their debounce (cooldown) timer is up and if it is teleport them.
You will also update the timer on the server using a loop that runs every second.
How would we know when to show the Ui?
We can locally check the time to make the Ui visible or not. Which can be done using a loop.
Hope this helped. If you need help writing the code let me know.
Maybe the script is loading faster than the block is loading in?
local part = workspace:WaitForChild("TeleportPart") -- Name of my part
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local humanoidrootpart = plr.Character:FindFirstChild("HumanoidRootPart")
if humanoidrootpart then
humanoidrootpart.CFrame = part.CFrame + Vector3.new(0,5,0)
end
end)