Hey everyone,
I just watched a YouTube video on E Circles. Everything works, but I want the player to hold on the E Circle, and then it does action.
Here is my script:
local inputservice = game:GetService("UserInputService")
local teleportservice = game:GetService("TeleportService")
inputservice.InputBegan:Connect(function(i,g)
if i.UserInputType == Enum.UserInputType.Keyboard then
if i.KeyCode == Enum.KeyCode.E then
local Mag = (workspace.Map.MainTeleport.Doorknob.Position-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
if Mag <= 22 then
workspace.Map.MainTeleport.Doorknob.Gui.EnterButton.BackgroundColor3 = Color3.fromRGB(145,145,145)
wait(.1)
workspace.Map.MainTeleport.Doorknob.Gui.EnterButton.BackgroundColor3 = Color3.fromRGB(255,255,255)
teleportservice:Teleport(5190764174, game.Players.LocalPlayer.Character)
end
end
end
end)

1 comment
try using the tick() feature: https://devforum.roblox.com/t/tick-how-do-i-use-it/422677/2