Jump to content

Access on script


Dardex

Recommended Posts

Hi guys I'm new at scripting but I know a lot of it.I have a script called superman that allows players to fly but i would like that script to be usable only from admins/supermoderators not from everyone.

local Superman = {}

-- Static global values

local rootElement = getRootElement()

local thisResource = getThisResource()

-- Resource events

addEvent("superman:start", true)

addEvent("superman:stop", true)

--

-- Start/stop functions

--

function Superman.Start()

local self = Superman

addEventHandler("superman:start", rootElement, self.clientStart)

addEventHandler("superman:stop", rootElement, self.clientStop)

end

addEventHandler("onResourceStart", getResourceRootElement(thisResource), Superman.Start, false)

function Superman.clientStart()

setElementData(client, "superman:flying", true)

end

function Superman.clientStop()

setElementData(client, "superman:flying", false)

end

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...