kikos500 Posted August 12, 2016 Posted August 12, 2016 so i want to make a movable dx window like gui one so i have tried this but it doesn't work function moving(cx,cy) for _,moving in pairs(elements_Table.windows) do if isCursorHover(moving.x,moving.y,moving.w,20) then outputChatBox("RIGHT PART") if getKeyState("mouse1") then -- if moving.movable then moving.x = moving.px - cx moving.y = moving.py - cy outputChatBox("moving") -- end end end end end addEventHandler("onClientCursorMove",root,moving) moving.px -- the default x for the window moving.py -- the default y for the window moving.x -- the window x moving.y -- the window y
Captain Cody Posted August 12, 2016 Posted August 12, 2016 Does it output either of them? Also either change your function name or change the name of what is outputted from the table.
kikos500 Posted August 12, 2016 Author Posted August 12, 2016 Yes both outputs but it doesn't move at all
Captain Cody Posted August 12, 2016 Posted August 12, 2016 Make it output moving.x and see if it says anything.
kikos500 Posted August 12, 2016 Author Posted August 12, 2016 it says some points but still the dx window doesn't move at all function testMoving(cx,cy) for _,moving in pairs(elements_Table.windows) do if isCursorHover(moving.x,moving.y,moving.w,20) then outputChatBox("RIGHT PART") if getKeyState("mouse1") then -- if moving.movable then moving.x = moving.px - cx moving.y = moving.py - cy outputChatBox(""..moving.x.." "..moving.y) -- end end end end end addEventHandler("onClientCursorMove",root,testMoving)
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