local model = script.Parent.Parent.Parent
local teleports = workspace.Teleport
local loc = teleports.Showcase
local values = model.Values
local proximityPrompt = script.Parent
local isTouched = false
print("Locals")
proximityPrompt.Triggered:Connect(function(player)
print("Activation")
local char = player.Character
local humanoid = char:FindFirstChildWhichIsA("Humanoid")
print("Humanoid")
if humanoid then
if not isTouched then
isTouched = true
print("Debounce")
local gui = player.PlayerGui.Frame
local frame = gui.Frame
local loca = frame.Location
local label = frame.Label
local text = frame.Text
local gif = frame.GIF
for i = 1,10 do
loca.Text = loc.Name
frame.BackgroundTransparency -= 0.1
gif.ImageTransparency -= 0.1
loca.TextTransparency -= 0.1
label.TextTransparency -= 0.1
text.TextTransparency -= 0.1
loca.UIStroke.Transparency -= 0.1
label.UIStroke.Transparency -= 0.1
text.UIStroke.Transparency -= 0.1
wait(0.000001)
end
print("Gui Load")
player.Character.HumanoidRootPart.Position = loc.Position
wait(2)
for i = 1,10 do
frame.BackgroundTransparency += 0.1
gif.ImageTransparency += 0.1
loca.TextTransparency += 0.1
label.TextTransparency += 0.1
text.TextTransparency += 0.1
loca.UIStroke.Transparency += 0.1
label.UIStroke.Transparency += 0.1
text.UIStroke.Transparency += 0.1
wait(0.000001)
end
print("Gui Delete")
wait(2)
isTouched = false
print("Debounce Again")
end
end
print("End")
end)
If you know what the issue is please get back to me, thank you.
I just changed my script to this article but i’m still having the same issue every time, it works but then it stops working after one time, do you know why?
local model = workspace.Portal
local teleports = workspace.Teleport
local loc = teleports.Showcase
local values = model.Values
local proximityPrompt = script.Parent
local isTouched = false
local RunService = game:GetService("RunService")
local ObjectActions = {}
function ObjectActions.promptTriggeredActions(promptObject, player)
local ancestorModel = promptObject:FindFirstAncestorWhichIsA("Model")
local valueFolder = ancestorModel:FindFirstChild("Values")
local soundFolder = ancestorModel:FindFirstChild("Sounds")
local char = player.Character
local humanoid = char:FindFirstChildWhichIsA("Humanoid")
if humanoid then
if not isTouched then
isTouched = true
if ancestorModel.Name == "Portal" then
local gui = player.PlayerGui.Frame
local frame = gui.Frame
local loca = frame.Location
local label = frame.Label
local text = frame.Text
local gif = frame.GIF
for i = 1,10 do
loca.Text = loc.Name
frame.BackgroundTransparency -= 0.1
gif.ImageTransparency -= 0.1
loca.TextTransparency -= 0.1
label.TextTransparency -= 0.1
text.TextTransparency -= 0.1
loca.UIStroke.Transparency -= 0.1
label.UIStroke.Transparency -= 0.1
text.UIStroke.Transparency -= 0.1
wait(0.000001)
end
player.Character.HumanoidRootPart.Position = loc.Position
wait(2)
for i = 1,10 do
frame.BackgroundTransparency += 0.1
gif.ImageTransparency += 0.1
loca.TextTransparency += 0.1
label.TextTransparency += 0.1
text.TextTransparency += 0.1
loca.UIStroke.Transparency += 0.1
label.UIStroke.Transparency += 0.1
text.UIStroke.Transparency += 0.1
wait(0.000001)
end
wait(2)
isTouched = false
end
end
end
end
return ObjectActions
local model = script.Parent.Parent.Parent
local teleports = workspace:WaitForChild("Teleport")
local loc = teleports:WaitForChild("Showcase")
local values = model:WaitForChild("Values")
local proximityPrompt = script.Parent
local isTouched = false
proximityPrompt.Triggered:Connect(function(player)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local hmr = character:WaitForChild("HumanoidRootPart")
if humanoid then
if not isTouched then
isTouched = true
local gui = player:WaitForChild("PlayerGui")
local frame = gui:WaitForChild("Frame")
local location = frame:WaitForChild("Location")
local label = frame:WaitForChild("Label")
local text = frame:WaitForChild("Text")
local gif = frame:WaitForChild("GIF")
for i = 1, 10 do
location.Text = loc.Name
frame.BackgroundTransparency -= 0.1
gif.ImageTransparency -= 0.1
location.TextTransparency -= 0.1
label.TextTransparency -= 0.1
text.TextTransparency -= 0.1
location.UIStroke.Transparency -= 0.1
label.UIStroke.Transparency -= 0.1
text.UIStroke.Transparency -= 0.1
task.wait()
end
hmr.Position = loc.Position
task.wait(2)
for i = 1, 10 do
frame.BackgroundTransparency += 0.1
gif.ImageTransparency += 0.1
location.TextTransparency += 0.1
label.TextTransparency += 0.1
text.TextTransparency += 0.1
location.UIStroke.Transparency += 0.1
label.UIStroke.Transparency += 0.1
text.UIStroke.Transparency += 0.1
wait()
end
task.wait(2)
isTouched = false
end
end
end)
I fixed the following (unless you meant for it to be a Frame inside of a Frame), the names seem wrong though “gui” & “frame”.
local gui = player.PlayerGui.Frame
local frame = gui.Frame
I’ve added waits to ensure everything that is requested by the script has loaded by the time the script executes, I’ve replaced wait() with task.wait() as it’s more optimised, on an additional note making calls like “wait(0.0000001)” isn’t necessary, the shortest length of time a wait() call can last for is 1/60th of a second which is “wait(0.01666)”, this is the default used when calling wait() without an argument.