I am working on a game that involves Proximity Prompts. The players will trigger the proximity prompts to get a tool.
local prox = script.Parent script.Parent.Triggered:Connect(function(player) prox.Enabled = false script.Parent.Parent.Transparency = 1 local rs = game:GetService("ReplicatedStorage") local GasCan = rs:FindFirstChild("Gas Can") GasCan.Parent = player.Backpack end)
This did work, however, when the player triggered the proximity prompt to get the tool, other players could not get the tool when they triggered the prompt. So, what I did was remake the script so this time it would Clone the tool, and put the Clone inside the player's Backpack. Not the actual tool.
local prox = script.Parent script.Parent.Triggered:Connect(function(player) prox.Enabled = false script.Parent.Parent.Transparency = 1 local rs = game:GetService("ReplicatedStorage") local clomes = rs:FindFirstChild("Gas Can"):Clone() clomes.Parent = player.Backpack end)
That script did fix the problem, but created a new one as well. Now, when any player triggers the event, the proximity prompt doesn't go away, meaning that the players can just duplicate the same item over and over again in their inventory. What it's supposed to do is make the Gas Can go Invisible, and disable the Proximity.
The weird thing is, it only works for the bottom half of the script, and it basically just ignores the part where it's supposed to Disable the prox and make a Gas Can invisible.
Does anyone know how to fix this?