Crab Posted February 10, 2018 Share Posted February 10, 2018 (edited) Someone Please Help Me. I am wrote a script about this topic. This definetly working but i want after the create object write into the chat /cam and remove this objects. Please help me. function consoleCreateObject ( thePlayer, commandName ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) -- get the player's position -- create a Object next to the player: local theObject1 = createObject ( 980, x + 2, y + 2, z, 0, 0, 0 ) local theObject2 = createObject ( 980, x + 3, y + 3, z, 0, 0, 0 ) local theObject3 = createObject ( 980, x + 4, y + 4, z, 0, 0, 0 ) local theObject4 = createObject ( 980, x + 5, y + 5, z, 0, 0, 0 ) end end end addCommandHandler ( "cab", consoleCreateObject ) Edited February 11, 2018 by jhxp 1 Link to comment
MrKAREEM Posted February 10, 2018 Share Posted February 10, 2018 the used Codes OnPlayerChat DestroyElement And Its The Full Code :- function onChat(message, messageType) if string.find(message, 'cam') then -- Searches for the string 'cam' in the message sent destroyElement(local theObject1) -- destroy element object 1 destroyElement(local theObject2) -- destroy element object 2 destroyElement(local theObject3) -- destroy element object 3 destroyElement(local theObject4) -- destroy element object 3 end end --End of the function addEventHandler("onPlayerChat", getRootElement(), onChat) Link to comment
Crab Posted February 10, 2018 Author Share Posted February 10, 2018 4 hours ago, MrKAREEM said: the used Codes OnPlayerChat DestroyElement And Its The Full Code :- function onChat(message, messageType) if string.find(message, 'cam') then -- Searches for the string 'cam' in the message sent destroyElement(local theObject1) -- destroy element object 1 destroyElement(local theObject2) -- destroy element object 2 destroyElement(local theObject3) -- destroy element object 3 destroyElement(local theObject4) -- destroy element object 3 end end --End of the function addEventHandler("onPlayerChat", getRootElement(), onChat) This is not working Link to comment
MrKAREEM Posted February 11, 2018 Share Posted February 11, 2018 12 hours ago, Crab said: This is not working Try Makin The Object With Bone Attach it would be easy And My Code Will Work bone attach and its a topic about it How To Attach Objects Bone Attach Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now