How do i make a Custom ProximityPrompt like pet sim?
I’ll send you a screenshot of my proximitypromt…Its just a Billboard GUI with a TextButton shaped into circle
Im pretty sure thats Just A Billboard Gui
, With An Image Button with the Image of E
.
To make It have Animations like Pressed
And Normal
, We Can Just Use 2 Different Images And UserInputService.
Example
UserInputServer.InputBegan:Connect(function(input,gameproccessed)
if not gameproccessed then
if input.KeyCode == Enum.KeyCode['E'] then
-- We Just Change the Image of the Circle to A Pressed Image
BillboardGui.ImageButton.Image = 'your pressed image id'
end
end
end)
--[[
Then we use the opposite to turn it back to normal, when we stop pressing E
--]]
UserInputServer.InputEnded:Connect(function(input,gameproccessed)
if not gameproccessed then
if input.KeyCode == Enum.KeyCode['E'] then
-- We Just Change the Image of the Circle to A Normal Image
BillboardGui.ImageButton.Image = 'your normal image id'
end
end
end)
To make it appear when the player goes near the object,
we can Use RunService
local ObjectsWithE = {workspace.Part} -- put the objects with the billbord gui
RunService.RenderStepped:Connect(function()
for i, Obj in pairs(ObjectsWithE) do
local Mag = (Player.Character.HumanoidRootPart.Position - Obj.Position).Magnitude
if Mag < 15 then -- 15 Is the Distance, the lesser it is, the closer the player is
Obj.BillboardGui.Enabled = true
else
Obj.BillboardGui.Enabled = false
end
end
end)
2 Likes
Wait Wheez WOW im such a big fan
Btw do i put it inside the ImageButton?
Btw its for my V.I.P Area that if a player Taps it or with the Keycode the Purchaser Appears
the script i gave was just an example,
you can use it in StarterPlayerScripts
and define the variables/set it up correctly.
ooooh ok thank you so much Wheez btw i love your Videos
About that…I don’t know how to script…Hehe