Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Utilities Class for APICO Modding
- local Utilities = {}
- -- Function to get the player's current position
- function Utilities:getPlayerPosition()
- local position = api_get_player_position()
- if position then
- return { x = position.x, y = position.y }
- else
- api_log("Utilities", "Failed to retrieve player position.")
- return nil
- end
- end
- function define_obj(id, name, catagory, tooltip, isBed, has_shadow, destTool, depth, spriteLoc)
- local obj = {
- id = id,
- name = name,
- category = catagory,
- tooltip = tooltip,
- bed = isBed, -- this allows it to be used as a bed
- has_shadow = has_shadow,
- tools = {destTool},
- depth = depth -- this sets the layering of the player + the object
- }
- api_define_object(obj, spriteLoc, nil)
- end
- return Utilities
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement