Ight friends, Hello!
I got a bit of an issue.
Within the player character there is a boolean value that when you equip a tool it will make it true. (And then false when unequipped.) The script below works on that part. Making it true; however only on the client side.
For context: I have a Part that has a proximity prompt within it. Within that prox prompt is a script (not a local script, just a regular script) that checks if your players boolean is true; if its true it will enable the prox prompt so It can be clicked.
Before the ProximityPrompt.Triggered:Connect, is a while loop that basically checks every half a second if the boolean (within the local player) is enabled. If it is, like before stated. It will allow the prompt to be used.
All the script seems to do is enable the boolean inside the character but thats it. It doesnât seem to work on the server. Before I had the boolean inside the game (game.Workspace.BoolValue). and the tool worked then so did the proximity prompt on the part. Idk if its just me being stupid or what.
This is the toolâs LocalScript that is enabling the Boolean within the player.
(I only added the important stuff so even though there is seemingly âMissing localsâ donât fret.)
local ProximityPrompt = game.Players.LocalPlayer.EnableProximityPrompt
local tool = script.Parent
local Equipped = false
local UID = game:GetService("UserInputService")
tool.Equipped:Connect(function(plr)
anim:Play()
Equipped = true
ProximityPrompt.Value = true
end)
tool.Unequipped:Connect(function(plr)
anim:Stop()
Equipped = false
ProximityPrompt.Value = false
end)
I also have a regular server script (not a local script) within the tool as well, to set the bool to true on the server side. But that script doesnt work. This is said script:
local ProxBool = game.Players.LocalPlayer.EnableProximityPrompt
tool.Equipped:Connect(function()
ProxBool .Value = true
print("Server Prox On")
end)
tool.Unequipped:Connect(function()
ProxBool .Value = false
print("Server Prox Off")
SeedNumber.Value = 0
end)
I donât know what the true issue is? My coding skills arenât the best so if you know whatâs wrong, have any help, references, solutions, or advice; Itâs much appreciated
If I also need to explain more or give more information regarding code please let me know! I believe I added everything important.