#proximity prompt (simple question)

42 messages · Page 1 of 1 (latest)

jolly rose
#

just set debounce

#

local debounces = {}

prompt.Triggered:Connect(function(player: Player)

-- Here controll when u wanna stop the player

if debounces[player.UserId] then return end

debounces[player.UserId] = true

task.wait(5)

debounces[player.UserId] = nil

end)

echo glade
#

script.Parent.Triggered:Connect(function(player)

player["Player Data"].Diamonds.Value = player["Player Data"].Diamonds.Value +5

script.Parent.Enabled = false

wait(5)

script.Parent.Enabled = true

end)

jolly rose
#

Yes so basically what i did but in that script

echo glade
#

but i tested it with my sister and it was kind of annoying when she triggered it, and it gave her currency but it disapeared for me and didint give me anything

#

ill try

violet zodiac
#

you might be using a local script

echo glade
jolly rose
violet zodiac
#

ik

jolly rose
#

So? It might be a serverscript

echo glade
# jolly rose So? It might be a serverscript

script.Parent.Triggered:Connect(function(player:Player)

local debounces = {}

player["Player Data"].Diamonds.Value = player["Player Data"].Diamonds.Value +5

if debounces[player.UserId] then return end

script.Parent.Enabled = false

debounces[player.UserId] = true

wait(5)

debounces[player.UserId] = nil

script.Parent.Enabled = true

end)

#

idk if i did it right

echo glade
jolly rose
#

Yes

jolly rose
echo glade
#

move it at the very top?

jolly rose
#

Move It out of the function, instead It Will create a new debounces table everytime the function runs u understand?

jolly rose
#

Wells basically that if everytime the function runs the table IS not saved so u cant really store It

#

So Its like no debounce

echo glade
#

local debounces = {}

script.Parent.Triggered:Connect(function(player:Player)

player["Player Data"].Diamonds.Value = player["Player Data"].Diamonds.Value +5

if debounces[player.UserId] then return end

script.Parent.Enabled = false

debounces[player.UserId] = true

wait(5)

debounces[player.UserId] = nil

script.Parent.Enabled = true

end)

echo glade
jolly rose
#

Yes, delete the two enabled lines

echo glade
jolly rose
#

No

echo glade
#

only for the player who triggers it not everyplayer

jolly rose
#

It already doesnt let the player press until 5 seconds

jolly rose
#

Thats why im using a table

#

So please, delete these

echo glade
#

i tried it and it didint work lemme check the outputt

jolly rose
#

Send code if keep

echo glade
# jolly rose Send code if keep

local debounces = {}

script.Parent.Triggered:Connect(function(player:Player)

player["Player Data"].Diamonds.Value = player["Player Data"].Diamonds.Value +5

if debounces[player.UserId] then return end

debounces[player.UserId] = true

wait(5)

debounces[player.UserId] = nil

end)

steep laurelBOT
#

studio** You are now Level 3! **studio

jolly rose
echo glade
#

it kinda works it only gives me currency when i click it every 5 seconds but it didint make the prompt disapear for 5 seconds

jolly rose
#

It doesnt, but doesnt let player interact with until 5 seconds

whole rain
#

im sorry for interupting but could one of yall help me after yall are done with this thanks

jolly rose
#

U can send a remote event to the player and disable and enable from localscript ok?