Skip to content

CreateInteraction

Places an invisible spot with your use prompt - “Read the notices”, “View the house”, “Drink”.

An entity of ENTITY_INTERACTION that nobody sees: a player who looks at it from close by gets the game’s own use hint with your text (as written, up to 48 characters; one that starts with @ is a text key of the game’s own), and the use key calls OnPlayerInteract. size is the round area to look at, in metres (0.6 by default, 0.2 to 3): about a man’s height tall from the point up, so put the point on the ground or the floor under what it stands for. SetEntityPrompt changes its text, DestroyEntity removes it, a reload removes them all. world is the virtual world (nil = the shared one).

CreateInteraction(x, y, z, label [, size, world])
Parameter Type
x number metres
y number metres
z number metres (the foot of the spot)
label string the use prompt
size number the round area to look at, metres (0.6) (optional)
world number the virtual world; nil = the shared one (optional)

number - the point’s entity id; nil for an empty prompt or a full world

-- a house for sale: its sign opens the mode's page
local sign = CreateInteraction(1302.4, 1088.9, 26.4, "View the house", 0.8)
function OnPlayerInteract(pid, id)
if id == sign then
SendPlayerWebMessage(pid, "house", { price = 1200 })
ShowPlayerWebFrame(pid, "house")
end
end

OnPlayerInteract · SetEntityPrompt · GetEntityPrompt · DestroyEntity · the Props group of the index