Jump to content

[Help] I can go Inside the Object


Recommended Posts

not working but have a look at my script

  
function base() 
if source == GUIEditor.button[1] then 
local x, y, z = getElementPosition(localPlayer) 
base = createObject(8240, x , y +5 , z +5 ) 
setObjectScale(base, 0.5) 
baseCol = createColSphere(x , y +5, z +5) 
attachElements(baseCol, base, 0, 0, 0) 
end 
end 
addEventHandler("onClientGUIClick", root, base)   

Link to comment

that's because you changed the visible size of the object. try this

  
-- Client side 
function base() 
    if source == GUIEditor.button[1] then 
        triggerServerEvent("eventName",localPlayer) 
    end 
end 
addEventHandler("onClientGUIClick", root, base)  
  
-- Server side 
function functionName() 
    local x, y, z = getElementPosition(source) 
    local base = createObject(8240, x , y +5 , z +5 ) 
    baseCol = createColSphere(x , y +5, z +5) 
    attachElements(baseCol, base, 0, 0, 0) 
    if base then  
    setObjectScale(base, 0.5) 
    setElementCollisionsEnabled(base, true) 
   end  
end  
addEvent("eventName",true) 
addEventHandler("eventName",root,functionName) 

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...