I want do disable just a proximityprompt for one client but it doesn’t work.
( And UI’s doesn’t being visible at LocalScript)
Script:
script.Parent.Triggered:Connect(function(player)
if player.config.job.Value == game.ReplicatedStorage.jobs.weapon_dealer.Value then
print("weapon_dealer EVENT_A1")
script.Parent.RemoteEvent2:FireClient(player)
else
script.Parent.RemoteEvent:FireClient(player)
end
end)
You’re disabling the script and then expecting it to suddenly re-enable itself after a couple seconds. You could have a debounce on the server for the player and if they are still on cooldown then don’t fire client. No need to disable/enable the script. Just toggle visibility. Let the server or client do the cooldowns to prevent firing
script.Parent.Triggered:Connect(function(player)
if player.config.job.Value == game.ReplicatedStorage.jobs.weapon_dealer.Value then
print("weapon_dealer EVENT_A1")
script.Parent.RemoteEvent:FireClient(player, "doAnotherThing")
else
script.Parent.RemoteEvent:FireClient(player, "doThing")
end
end)
Client Code:
local player = game:GetService("Players").LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
script.Parent.RemoteEvent.OnClientEvent:Connect(function(action)
if action == "doThing" then
playerGui.alert.Frame.weapondealeralert_a.Visible = true
task.wait(7)
playerGui.alert.Frame.weapondealeralert_a.Visible = false
else if action == "doAnotherThing" then
script.Parent.Parent.sound:Play()
end
end)
I may have missed something, wrote this pretty quickly. But hopefully you get the idea.