Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why isn't this ProximityPrompt firing?

Asked by
niroqeo 123
1 year ago

I've been at this for almost an hour now and have no idea why it doesn't work.

-- clone is a model duplicated from serverstorage

for i, part in pairs(clone:GetDescendants()) do
    if part.Name == "primary" then
        local prompt = Instance.new("ProximityPrompt")
        prompt.Name = "BoxPrompt"
        prompt.RequiresLineOfSight = false
        prompt.HoldDuration = 4

        prompt.Parent = part

        prompt.Triggered:Connect(function(plr)
            local char = plr.Character
            print('triggered!!!!!!!!!!') -- doesn't print

            -- some more extra stuff that really doesn't matter
        end)
    end
end

I'm gonna go to sleep, it's almost 2am and I want to die.

2 answers

Log in to vote
0
Answered by
NEILASc 84
1 year ago
Edited 1 year ago

read the documentation on prompts

but it worked for me so im guessing is anything called primary? like with no captials. or is it a server or client thing? try switching it to a client or server. i used server.

not sure if this might help but this worked for me

Ad
Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

I would say just keep it as ProximityPromt instead of promt and check the console since that where printed stuff goes

Answer this question