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

How to Change Proximity Prompt Hold duration in game?

Asked by 2 years ago

Im making game when you hold E by 4 sec you can sell this and get Coins and you can for Coins upgrade you stuff and im dont know how to change ProximityPrompt Hold Duration In game beacuse i CANT i can only Off game change hold duration pls help i need SCRIPT when you buy item you hold duration time is shorter 2 times and idk how to make this actually code bellow:

local ProximityPrompt = script.Parent.ProximityPrompt local Player = game.Players.LocalPlayer

while wait() do ProximityPrompt.HoldDuration = Player.DestroyTime.Value end

0
May you please format your code? It's kind of hard to read. Thanks! BirthWormSaiiy 48 — 2y

2 answers

Log in to vote
1
Answered by
Wayyllon 170
2 years ago

There's a property inside of Proximity Prompts called "HoldDuration" which you can change before the game even runs.

Helpful links:

https://developer.roblox.com/en-us/api-reference/class/ProximityPrompt

https://developer.roblox.com/en-us/api-reference/property/ProximityPrompt/HoldDuration

Ad
Log in to vote
0
Answered by 2 years ago

You can just change the Hold Duration by this line of code.

ProximityPrompt.HoldDuration = ProximityPrompt.HoldDuration / 2

Add that line of code to the function that gets called when the "Shorter HoldDuration item" is bought.

Answer this question