#Proximity Prompts arnt working.

1 messages · Page 1 of 1 (latest)

languid crown
#

I disabled all other scripts in my game and only had a part with a proximity prompt that printed if it was triggered but no prompt is triggering.

fair bay
#

@languid crown

languid crown
fair bay
#

just

#

paste in

languid crown
#

ok

fair bay
#
paste the code
#

like that

languid crown
#

how you do that

fair bay
languid crown
#

ah alr

#

also i just did this to see if it was something else effecting all prompts but it isnt. i also created a new game but they still dont work.

fair bay
#

its the one in top left of keyboard

#

the

#

`

#

and after lua put the rest of code on new lines

languid crown
#
local prompt = script.Parent.ProximityPrompt

prompt.Triggered:Connect(function()
    print("triggered")
end)
languid crown
fair bay
#

close enough lol

#

any errors?

languid crown
#

nope

fair bay
#

let me see the explorer

languid crown
#

but proximity prompts in all games i make dont work randomly but i go on a place sb else made and they work

languid crown
languid crown
fair bay
#

I see

#

your using

#

a localscript

languid crown
#

even normal script wouldnt work

fair bay
#

try a normal script

#

local script will not work at all

languid crown
#

worked that time

#

needa figure out whats going wrong in other things then

fair bay
#

yea, local scripts cant run on the server

languid crown
#

thank

fair bay
#

np

#

good luck

languid crown
fair bay
#

?

languid crown
# fair bay ?

Im doing a building system and i got the part with the proximity and script to place but the prompt wont work

#

i can rec a video of problem if it would help

fair bay
#

is it in a local script or server script

#

and yes record video

languid crown
#

server

languid crown
fair bay
#

send script for the pot

languid crown
# fair bay send script for the pot
local SmallEmptyPot = script.Parent
local Prompt = SmallEmptyPot:WaitForChild("ProximityPrompt")

local Pots = game.ReplicatedStorage.Furniture:WaitForChild("Pots")
local SmallSoiledPot = Pots:WaitForChild("Small Soiled Pot")

local Players = game:GetService("Players")

local function onPromptTriggered(player)
    local character = player.Character
    if not character then return end

    local tool = player:FindFirstChildOfClass("Tool")
    if not tool then return end

    local typeValue = tool:FindFirstChild("Type")
    local countValue = tool:FindFirstChild("Value")

    if not typeValue or not countValue then return end
    if typeValue.Value ~= "Soil" then return end
    if countValue.Value < 1 then return end

    local humanoid = character:FindFirstChildWhichIsA("Humanoid")
    if humanoid then
        humanoid.WalkSpeed = 0
        humanoid.JumpPower = 0
    end

    Prompt:Destroy()

    task.wait(4)

    if humanoid then
        humanoid.WalkSpeed = 16
        humanoid.JumpPower = 50
    end

    local newPot = SmallSoiledPot:Clone()
    if SmallEmptyPot.PrimaryPart and newPot.PrimaryPart then
        newPot:SetPrimaryPartCFrame(SmallEmptyPot:GetPrimaryPartCFrame())
    else
        newPot:PivotTo(SmallEmptyPot:GetPivot()) 
    end

    local plotName = player.Name .. "Plot"
    local plotFolder = workspace:FindFirstChild("Plots") and workspace.Plots:FindFirstChild(plotName)
    local furnitureFolder = plotFolder and plotFolder:FindFirstChild("Furniture")

    if furnitureFolder then
        newPot.Parent = furnitureFolder
    else
        warn("Could not find Furniture folder for", player.Name)
        newPot:Destroy()
        return
    end

    countValue.Value -= 1

    SmallEmptyPot:Destroy()
end

Prompt.Triggered:Connect(onPromptTriggered)
fair bay
#

put a print after the if not tool then return end

#

see if it prints at all

languid crown
#

alr

languid crown
fair bay
#

yea

languid crown
#

also the prompt only shows if you holding the correct tool its a script in the tool for that

fair bay
#

I see the problem

fair bay
#

remove those 2 lines

#

and test

languid crown
#

still dosnt work sadly

fair bay
#

what did you change

#

oh wait

#

yea you have to check the players backpack

#

oh

#

hm

#

I looked up that should be working

#

lemme think

#

revert to old script

#

the original you sent me

languid crown
#

ok

fair bay
#

Idk I gtg for school

#

ill try to fix later

#

cya