Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I change this to a on click instead of touch?

Asked by 5 years ago
01local MarketplaceService = game:GetService("MarketplaceService")
02local TeleportService = game:GetService("TeleportService")
03local Players = game:GetService("Players")
04 
05local teleporter = script.Parent
06local showPrompt = true
07 
08local placeID_Premium = 012345678
09 
10local function onTeleporterTouch(otherPart)
11 
12    local player = Players:GetPlayerFromCharacter(otherPart.Parent)
13    if not player then return end
14 
15    -- If the user already has Premium, teleport them to the Premium-only place
View all 43 lines...
0
Add a click detector BradNewTypical 232 — 5y
0
Yeah Ik but what do I change in the script? no0bgaming748 24 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Change teleporter variable to refer to a ClickDetector.

change teleporter.Touched:connect... to teleporter.MouseClick:connect...

etc.

Ad
Log in to vote
0
Answered by 5 years ago

Its actually pretty simple. 1. Put in a ClickDetector.

1teleporter.ClickDetector.MouseClick:Connect(onTeleporterTouch)

assuming this is the line that you wanted converted to click, this should help you out.

0
thats a simple way of doing it i geuss so ye pretty simple Vetrodex 22 — 4y

Answer this question