【发布时间】:2021-08-11 21:49:46
【问题描述】:
有没有办法让 ROBLOX 接近提示仅在激活特定接近提示时才激活?这是我的代码。目前,如果任何提示被激活,它就会运行,但是我只想要一个接近提示来激活它。
script.Parent.ObjectText = script.Parent.Parent.Parent.Name
local ProximityPromptService = game:GetService("ProximityPromptService")
local label = script.Parent.Parent.Parent.Torso.SurfaceGui.TextLabel
local function typewrite(text,length)
for i = 1,#text,1 do
label.Text = string.sub(text,1,i)
wait(length)
script.Parent.Parent.DIALOGSOUND:Play()
end
wait(4)
label.Text = " "
end
local function onPromptTriggered(promptObject, player)
typewrite("hey there", 0.05)
end
ProximityPromptService.PromptTriggered:Connect(onPromptTriggered)
【问题讨论】:
标签: roblox