#scripting help needed

1 messages · Page 1 of 1 (latest)

barren rivet
#

Whenever I click the UI it doesnt tp me to the part it instead tps me to the void!

wait(1)
player = game.Players.LocalPlayer
button = script.Parent
local debounce = false

function teleport()
if not debounce then
debounce = true
LowerTorso = player.Character.LowerTorso
LowerTorso.CFrame = game.Workspace.ShopTeleportUI.CFrame
end
end

button.MouseButton1Click:Connect(teleport)
while true do wait()
debounce = false
wait(2)
end

#

wrong clip

bleak wraith
#

i think the reason for this error is because u didn't add the correct position

#

@barren rivet

barren rivet
#

oh

bronze crystal
#

yoo so uhh

barren rivet
#

can u explain me how to?
.

bronze crystal
#

wait(1)
local player = game.Players.LocalPlayer
local button = script.Parent
local debounce = false

button.MouseButton1Click:Connect(function()
if debounce then return end
debounce = true

local target = game.Workspace.ShopTeleportUI
if target then
    player.Character.HumanoidRootPart.CFrame = target.CFrame
else
    print("ShopTeleportUI not found!")
end

wait(1)
debounce = false

end)
whaT I ChAnged:
Removed the unnecessary loop and simplified the debounce logic.

Used a MouseButton1Click connection with a cleaner function.

Added a small delay and made sure the script doesn’t do anything if debounce is true.

A check to see if ShopTeleportUI exists before attempting to teleport.

Let me know if that works better!

#

took long enough hope it hekps!

barren rivet
#

still tps me to the void

bronze crystal
#

Oh

#

I'ma find another way then

oak totem
#

show the explorer?

#

screenshot?

bronze crystal
#

yo i think the problem is u teleportin to ShopTeleportUI, that sound like a UI not a part 😭
u needa make sure u teleportin to an actual part in workspace
change this line:

LowerTorso.CFrame = game.Workspace.ShopTeleportUI.CFrame
To like this:
LowerTorso.CFrame = game.Workspace.ShopTeleportPart.CFrame

make sure the part exist n name match too 👀
hope it fix it bro🔥 lmk if still bugged

barren rivet
barren rivet
simple oar
#

uh

#

why do you have

#

localscript

#

and shopteleportbuttonscript

barren rivet
#

Idk

sharp elbowBOT
#

studio** You are now Level 9! **studio

barren rivet
#

its for that

swift crystal
#

can we see the shop folder?

simple oar
#

so you have a whole script for firing an event instead of putting it in one