Why duration of ProximityPrompt isn't changing?

  1. What do you want to achieve? Keep it simple and clear!

Change duration of “ProximityPrompt” for local player;

  1. What is the issue? Include screenshots / videos if possible!

Isn’t haven’t an errors in output, but duration not changing…

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

StarterCharacterScripts →

local IsOk = true

repeat
	game.ReplicatedStorage.coins:WaitForChild("Coin1").ProximityPrompt.HoldDuration = 5
	game.ReplicatedStorage.coins:WaitForChild("Coin2").ProximityPrompt.HoldDuration = math.random(5)
	game.ReplicatedStorage.coins:WaitForChild("Coin3").ProximityPrompt.HoldDuration = 5
	game.ReplicatedStorage.golds:WaitForChild("Gold1").prompt.ProximityPrompt.HoldDuration = 5
	game.ReplicatedStorage.coins:WaitForChild("Arm").ProximityPrompt.HoldDuration = 5
	game.ReplicatedStorage.coins:WaitForChild("Torso").ProximityPrompt.HoldDuration = 5	
until IsOk
1 Like

Why are you using repeat until IsOk is true if you’re already setting it to true? Plus, why are you trying to loop?

Because it will sometimes change in another script

if ou repeat setting it to 5 it wont change because it is already set to 5,
and maybe it happens so fast it is already done when the game is loaded
assuming that is 1 script with nothing more

Hm, why are you trying to loop it? And why is there a math.random when there’s only one value it can lead to?

I suggest to not loop it and have the script run with those primary lines.

Also, what’s the context behind the script? What are you making?

1 Like

math.random() for random number.

Not working with primary lines.

Nothing.

Well you can’t get a random number if you only put one parameter inside of the parentheses, since it will then only get that value.

?? Well guessing from this script you want a player to pick up coins and items but have the HoldDuration different, and since you placed these items in ReplicatedStorage, you’re trying to clone these items onto a playing field?

But honestly, if you can’t provide much, it’s hard to help.

That’s right. I don’t think this information will help you. But then I will try to describe more.

This is not true, everything works as it should even with one parameter.
*UPD: Although it may not be stable, but so far I have not observed any problems.

I was able to solve the problem.

Before cloning, I need to change the duration of “ProximityPrompt” in “ReplicatedStorage”. But since the value was sent from local and cloning from the server - it is obvious that it will not work.

Thanks to who tried to help! Sorry for providing little information.
@aswdgsagdb @bloodbonniekingnoob1 @Qin2007

2 Likes