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
2 years ago

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

01-- clone is a model duplicated from serverstorage
02 
03for i, part in pairs(clone:GetDescendants()) do
04    if part.Name == "primary" then
05        local prompt = Instance.new("ProximityPrompt")
06        prompt.Name = "BoxPrompt"
07        prompt.RequiresLineOfSight = false
08        prompt.HoldDuration = 4
09 
10        prompt.Parent = part
11 
12        prompt.Triggered:Connect(function(plr)
13            local char = plr.Character
14            print('triggered!!!!!!!!!!') -- doesn't print
15 
16            -- some more extra stuff that really doesn't matter
17        end)
18    end
19end

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
2 years ago
Edited 2 years 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 2 years ago
Edited 2 years 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