
WiBox
Members-
Posts
234 -
Joined
-
Last visited
Everything posted by WiBox
-
Sorry for asking but can you fix this coding? local Time1 = 3600000 function a( plr ) function timer() setTimer(function() if Time1 >= 0 then Time1 = Time1-600000 for _, in ipairs () do outputChatBox("The event will start every hour once. TimeLeft:"..Time1" Seconds.", localPlayer, 0, 255, 0) timer() end end end, 600, 1 ) end addEventHandler("onResourceStart", root, timer ) end
-
Thanks, I'll try it, what I'm doing is a event, each 1 hour it will be auto-started, so I made every 5 minutes it will appear a message for they know which time left for the event start, i need a way to they know how much remain so the event starts. I appreciate you're help
-
What I mean example: Time left is 12300 second! after 2300 seconds.. Time left is 10000 second! that what I don't know the basics or what the command for use.. And if you can make it or make a example I'll appreciate that.
-
For use as Help please? I was trying but I don't got a idea from where i start outputChatBox("......., Time left:"..Time1.. "seconds.", localPlayer, 255, 255, 0) time which I need is 1 hour ( 3600 seconds ) I need that the time left will be 1 hour and each each 5 minutes I made it appear my only problem i need the time left to work, I don't know the basics of make how much time left... I appreciate who help.
-
Thanks! It worked, i really appreciate you're help
-
I know i should use those, but I didn't know how to make each second remove 20 health.. setTimer ( function ( plr ) setElementHealth ( plr , getElementHealth( plr ) - 20 ) end, time.., 1) but about each second?
-
Hey can someone tell me a way as each time a player isn't in the colshape he will lose 20 hp in a second, I know everything just I need help for each second the player get -20 HP Zone1 = createColTube ( ..., ..., ....) function outsidetheColShape ( plr ) if ( isElementWithinColShape ( plr, Zone1 ) ) then -- i need help in this line please.... about the health.. end end
-
You can use /n it will write on new line example: well i think if you used Space and used /n it may work example: HI HOW /nARE/nYOU. it will be written as: HI How ARE YOU. but you should add spaces so you make the text in middle of the memo, it's a hard way to do but that my only idea..
-
Bad argument @ 'getElementType' [Expected element at argument 1, got nil]
WiBox replied to DouglaS666's topic in Scripting
this one; if getElementType ( attacker ) == "ped" then or this one; if getElementType ( source ) == "player" then -
object = createObject(1337, 1500, 965, 10) -- "a name which you like " = createObject ("ID of the object", positionX, positionY, positionZ) local x, y, z = getElementPosition(object) -- the X, Y, Z = element position which is object setObjectRotation (object, x, y, z) -- you can use setElementRotation (object, x, y, z) the x y z = the second line of this coding.
-
shadow_team = createTeam("shadow",255,0,0) function shadow_func(player) local px,py,pz = getElementPosition(player) setPlayerTeam ( player, shadow_team ) triggerClientEvent(player, "onClientSoundEvent", player) shuk = exports [ "slothbot" ]:spawnBot ( px, py - 3, pz, 0, 164, 0, 0, getPlayerTeam(player), 10, "hunting", true ) setElementVelocity ( shuk, speedX, speedY, speedZ ) --for the speed x and y and z choose numbers as you like. setTimer ( function ( ) destroyElement(shuk) end ,500000, 1 ) outputChatBox("Kuchiyose Shadow Mini!", l_1_0, 255, 0, 0, false) end addCommandHandler("shadow-master-obito", shadow_func)
-
Hey, I got a question, you mean the duration of the player so he arrive to his destination right? If that what you mean you need to send the script of the Map Duration so we can edit pause or freeze for the time..
-
local player = getLocalPlayer () GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } function Panel() name = guiCreateWindow(856, 143, 264, 388, "Walking Style", false) guiWindowSetSizable(name, false) local label = guiCreateLabel(6, 1, 254, 15, "", false, GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(28, 44, 209, 308, false, GUIEditor.window[1]) local Default = guiCreateButton(10, 14, 189, 30, "Default", false, GUIEditor.gridlist[1]) local Drunk = guiCreateButton(10, 54, 189, 30, "Drunk Man", false, GUIEditor.gridlist[1]) local Sneak = guiCreateButton(10, 94, 189, 30, "Sneaking", false, GUIEditor.gridlist[1]) local Blind = guiCreateButton(10, 134, 189, 30, "Blind Man", false, GUIEditor.gridlist[1]) local Gangstar = guiCreateButton(10, 174, 189, 30, "Gangstar", false, GUIEditor.gridlist[1]) local Sexy = guiCreateButton(10, 214, 189, 30, "Sexy", false, GUIEditor.gridlist[1]) local fat = guiCreateButton(10, 254, 189, 30, "Fat man", false, GUIEditor.gridlist[1]) local Close = guiCreateButton(104, 357, 58, 17, "Done", false, GUIEditor.window[1]) showCursor ( true ) end addCommandHandler("ws", panel) function Reset() setPedWalkingStyle ( player, 0 ) end function Drunk() setPedWalkingStyle ( player, 126 ) end function Sneak() setPedWalkingStyle ( player, 69 ) end function Blind() setPedWalkingStyle ( player, 127 ) end function Gangstar() setPedWalkingStyle ( player, 121 ) end function Sexy() setPedWalkingStyle ( player, 132 ) end function Fat() setPedWalkingStyle ( player, 124 ) end function Close() guiSetVisible ( name, false ) showCursor ( false ) end addEventHandler ( "onClientGUIClick", Default, Reset, false ) addEventHandler ( "onClientGUIClick", Drunk, Drunk, false ) addEventHandler ( "onClientGUIClick", Sneak, Sneak, false ) addEventHandler ( "onClientGUIClick", Blind, Blind, false ) addEventHandler ( "onClientGUIClick", Gangstar, Gangstar, false ) addEventHandler ( "onClientGUIClick", Sexy, Sexy, false ) addEventHandler ( "onClientGUIClick", Fat, Fat, false ) addEventHandler ( "onClientGUIClick", close, close, false ) What is you're problem? What happen when you write /ws it open the Panel or not? you need to say what is happening with you so we can help. Try this: walkStyles = { {"Default", 0 }, {"Default Fat", 55 }, {"Default Muscular", 56 }, {"Sneak", 69 }, {"Man", 118 }, {"Fat Man", 124 }, {"Jogger Man", 125 }, {"Old Man", 120 }, {"Old Fat Man", 123 }, {"SWAT Moves", 128 }, {"Gangster 1", 121 }, {"Gangster 2", 122 }, {"Pro Sexy Woman", 133 }, {"Fat Woman", 135 }, {"Jogger Woman", 136 }, {"Old Woman", 134 }, {"Old Fat Woman", 137 }, {"Drinking", 126 }, {"Shuffle", 119 }, {"Blind Man", 127 } , {"Woman", 129 }, {"Busy Woman", 131 }, {"Sexy Woman", 132 }, } GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(352, 131, 513, 415, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(10, 24, 296, 381, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.5) guiGridListAddColumn(GUIEditor.gridlist[1], "ID", 0.4) GUIEditor.label[1] = guiCreateLabel(0.61, 0.07, 0.36, 0.11, "Select a walking style from the gridlist and click have style or cancel.", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) GUIEditor.label[2] = guiCreateLabel(313, 98, 184, 142, "Many walk styles don't allow you to run fast so use those walking styles at your loss. Some walking style have special abilities too, so try them out.", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "clear-normal") guiLabelSetHorizontalAlign(GUIEditor.label[2], "left", true) GUIEditor.button[1] = guiCreateButton(312, 368, 95, 37, "Have Style", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(412, 369, 91, 36, "Cancel", false, GUIEditor.window[1]) for ind,n in ipairs(walkStyles) do row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], row, 1, n[1], false, false) guiGridListSetItemText(GUIEditor.gridlist[1], row, 2, tostring(n[2]), false, false) end addEventHandler("onClientGUIClick", GUIEditor.button[1], select) addEventHandler("onClientGUIClick", GUIEditor.button[2], close) end ) local marker1 = createMarker( 773.5, -1, 999.7, 'Cylinder', 1.5, 255, 0, 0, 170 ) local marker2 = createMarker( 665, -1864, 4.5, 'Cylinder', 1.5, 255, 0, 0, 170 ) setElementInterior(marker1, 5) local marker3 = createMarker( 774, -71, 999.5, 'Cylinder', 1.5, 255, 0, 0, 170 ) setElementInterior(marker3, 7) function markerhit(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end end function close() guiSetVisible(GUIEditor.window[1],false) showCursor(false) end function select() local row, col = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if (row and col and row ~= -1 and col ~= -1) then local models = tonumber(guiGridListGetItemText(GUIEditor.gridlist[1], row, 2)) if model ~= "" then triggerServerEvent("walking", localPlayer, models) setPedWalkingStyle(localPlayer, models) guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end end addEventHandler("onClientMarkerHit", marker1, markerhit) addEventHandler("onClientMarkerHit", marker2, markerhit) addEventHandler("onClientMarkerHit", marker3, markerhit) addCommandHandler( "walkstyle", function () if ( guiGetVisible( GUIEditor.window[1] ) ) then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) else guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end end )
- 7 replies
-
- 1
-
-
- walking_style
- gui
-
(and 1 more)
Tagged with:
-
Well i was searching on https://wiki.multitheftauto.com and i found that Note: This function does not affect sounds which are already playing, such as the wind sound that can only be stopped by entering an interior. so i was thinking if he spawn in a interior another of 0 it will remove the wind sound then on Login the player will spawn in a random place of spawnpoints with random skin Tested and Worked~ function OnPlayerJoins () spawnPlayer ( source, 0, 0, 5, 0, math.random (0,288), 1, 0, Guest) end addEventHandler("onPlayerJoin", getRootElement(), OnPlayerJoins) local spawnpoints = { {1607, 1857, 11}, {2507, -1668, 13}, {1557, -1675, 16}, {1572, -1633, 13}, } local validSkins = {0, 1, 2, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312} addEventHandler("onPlayerLogin", root, function () if source and isElement( source ) then local x,y,z,r = unpack(spawnpoints[math.random(1,#spawnpoints)]) spawnPlayer( source, x+math.random(-3,3), y+math.random(-3,3), z, r, validSkins[math.random(1,#validSkins)], 0, 0) fadeCamera( source, true) setCameraTarget( source, source) showChat( source, true) end end ) Add it on Server Side ~
-
Hey, do you got a problem if you set the sound to 0 that mean he will not hear anything until he login into a account? If you don't got problem you can: function SoundOnLogin ( guest ) Guest = getPlayerAccount ( guest ) if isGuestAccount ( Guest ) then setSoundVolume(sound, 0) elseif ( not isGuestAccount ( Guest ) ) then setSoundVolume(sound, 1) end end addEventHandler("onResourceStart", localPlayer, SoundOnLogin ) That should fix it, I just removed the sound to the time the player login to his account the sound will back to normal.
-
Second? You just want to remove the Scrolling Bar right? If it's a Script then search for it and enter the script and search on " guiCreateScrollBar " or change the alpha to 0 or just remove the line of guiCreateScrollBar If you didn't understand what I mean, I mean just enter the resource of this window and as i said about the scroll bar.
-
But i can't rotate the Explosion.. so the player need to rotate on where is the rotation.
-
objs = {} addCommandHandler ( "explosion", function ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) local rx, ry, rz = getElementRotation ( thePlayer ) local mat = Matrix.create ( x+30, y+1, z+20, rx, ry, rz) local pos = ( Matrix.getPosition ( mat ) + forward ) setTimer (createExplosion, 2000, 1,x+30, y+1, z, 11) objs[thePlayer] = createObject(751, pos) moveObject( objs[thePlayer], 2000, x +30, y+1, z) end ) well i don't know why you added this " local origX, origY, origZ = getElementPosition ( thePlayer ) " as long you got " local x, y, z = getElementPosition ( thePlayer ) " so i remove it.. and i didn't understand for what was the " local newZ = origZ +0 " i removed it .. Nothing important happen, i just edit the x+ and y+ nothing more.. but i saw something that when the object get created, you need to remove it because it will not get auto removed.. so you can add a time so you can add: setTimer ( function () destroyElement ( objs[thePlayer] ) end, 5000, 1 ) as like that: objs = {} addCommandHandler ( "explosion", function ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) local rx, ry, rz = getElementRotation ( thePlayer ) local mat = Matrix.create ( x+30, y+1, z+20, rx, ry, rz) local pos = ( Matrix.getPosition ( mat ) + forward ) setTimer (createExplosion, 2000, 1,x+30, y+1, z, 11) objs[thePlayer] = createObject(751, pos) moveObject( objs[thePlayer], 2000, x +30, y+1, z) setTimer ( function () destroyElement ( objs[thePlayer] ) end, 5000, 1 end ) Hope i did something useful
-
.object = createObject ( 980, 1619, 1842, 11, 90, 0, 0 ) -- object position is at LV Hospital. function RemoveHpWhenObjectHitThePlayer ( thePlayer ) local x, y, z = getElementPosition ( object ) local marker = createMarker ( x + 1, x + 2, 2, "cylinder", 1, 255, 255, 0, 0 ) attachElements ( marker , thePlayer , 0, 0, 0 ) if isElementWithinMarker ( thePlayer , marker) do setElementHealth ( thePlayer, getElementHealth( thePlayer ) - 10 ) -- - 10 is how much it damage him, make it the number you like. end end addEventHandler ( "onMarkerHit", marker, RemoveHpWhenObjectHitThePlayer) i'm not sure if it will work but test it ~
-
Hello, now i'm trying to learn coding by checking how they make it, but some code are encrypted, i need a way for decrypt them. That's a picture of which encrypted coding, https://imgur.com/a/agJZyki if there anyone a way which i can decrypt this encrypted coding please share it with us, and thanks.