I have this part in the replicated storage, the script do a model:Clone(), which contains a script to detect trigger and a proximity prompt
so, when i clone it and move it to the workspace, iwhen the max distance setting is more than 12, it works normally
but when i
set the max distance anywhere lower than 12
i can still click it, but the script just dont run
although it still run with any max distance when the model is already in the workspace
#proximity prompt
1 messages · Page 1 of 1 (latest)
local spawnParts = require(game.ReplicatedStorage.Scripts.SpawningVars)
--[[local Prompt = Instance.new("ProximityPrompt")
Prompt.Name = "PickUp"
Prompt.Parent = script.Parent
Prompt.Enabled = true
Prompt.MaxActivationDistance = 4]]--
local Prompt = script.Parent.Lid:WaitForChild("PickUp")
local partNeeded = script.Parent:WaitForChild("partName").Value
local connected = false
game.ReplicatedStorage.Events.Spawn.OnServerEvent:Connect(function(player, value)
if value == "DoneTweening" and connected == false then
print("Name")
connected = true
Prompt.Enabled = false
task.wait(0.25)
Prompt.Enabled = true
Prompt.MaxActivationDistance = 7
end
end)
Prompt.Triggered:Connect(function()
table.insert(spawnParts, game.Workspace.SpawnLocations[partNeeded])
script.Parent:Destroy()
end)
``` the script to detect trigger in the model
can you elaborate a little bit more?
In the prompt I believe you need to set requirelineofsight to false
what is that