"Hello, I am new to scripting and require assistance with this Lua script:
local ProximityPrompt = script.Parent.Place
ProximityPrompt.Triggered:Connect(function(Player)
local Character = Player.Character
if script.Value.Value == 6 then
workspace.Sounds["PlaceItem"]:Play()
script.Parent.Parent.Model.Sword.Transparency = 0
script.Parent.Build.Enabled = true
ProximityPrompt:Destroy()
script:Destroy()
else
game.ReplicatedStorage.PartsNeeded:FireClient(Player)
end
end)
The script does not detect when the value changes to 6 during gameplay. Initially starting at 0, if the value changes to 6 while the game is running, the script fails to recognize this change and triggers the not intended event."
I am unsure if this is the answer you are looking for, but here’s what I think. You say that the script doesn’t detect the value change. This script is not going to always work because the event only triggers when the proximity prompt gets triggered. That means that this script is only going to check if the value is equal to six when you trigger the prox prompt. If this isn’t the right answer, please just provide more info and i’ll look into it.
I understand that the script checks the value only when the proximity prompt is triggered. However, even after verifying that the value is 6, the script still does not work and it fires the “PartsNeeded” event.
I didn’t mean like that
When you are testing, there is a button on the top called “Current-Client”. When you change the value, is that button set to “Current-Server”?
Thats the problem.
Server doesnt see Client changes.
You are running a Server script that checks on that value, However as I said before, for server that value is still Zero