├── fxmanifest.lua ├── README.md ├── config.lua └── client └── walking.lua /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | 3 | game 'gta5' 4 | 5 | description 'ps-walks' 6 | 7 | version '1.0.0' 8 | 9 | shared_script 'config.lua' 10 | 11 | client_script 'client/*.lua' 12 | 13 | lua54 'yes' -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![image](https://user-images.githubusercontent.com/82112471/209208440-0d2eddef-dec1-41f6-a79a-09ae9edbbb7b.png) 2 | 3 | # ps-walkingstyles 4 | This may seem like a small feature, but it adds an extra level of immersion and personalization. This script allows players to set and save their preferred walk style, which will persist even after the server is restarted. Players can choose from a variety of walk styles, ranging from casual strolls to confident strides, and have their character consistently reflect their chosen style 5 | 6 | ![Project Sloth Buttons](https://user-images.githubusercontent.com/91661118/169454003-488c8994-eec9-4b92-9b0c-f3a675be7d1b.png) 7 | 8 | # Install 9 | * Drag and drop 10 | * Ensure ps-walkingstyles 11 | 12 | # Showcase 13 | ![image](https://user-images.githubusercontent.com/82112471/209202519-2885c0ff-845c-44ec-a13a-372af35cfc6d.png) 14 | -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | Config.WalkingSyles = { 4 | ["arrogant"] = 'move_f@arrogant@a', 5 | ["casual"] = 'move_m@casual@a', 6 | ["casual2"] = 'move_m@casual@b', 7 | ["casual3"] = 'move_m@casual@c', 8 | ["casual4"] = 'move_m@casual@d', 9 | ["casual5"] = 'move_m@casual@e', 10 | ["casual6"] = 'move_m@casual@f', 11 | ["confident"] = 'move_m@confident', 12 | ["business"] = 'move_m@business@a', 13 | ["business2"] = 'move_m@business@b', 14 | ["business3"] = 'move_m@business@c', 15 | ["femme"] = 'move_f@femme@', 16 | ["flee"] = 'move_f@flee@a', 17 | ['muscle'] = 'move_m@muscle@a', 18 | ["gangster"] = 'move_m@gangster@generic', 19 | ["gangster2"] = 'move_m@gangster@ng', 20 | ["gangster3"] = 'move_m@gangster@var_e', 21 | ["gangster4"] = 'move_m@gangster@var_f', 22 | ["gangster5"] = 'move_m@gangster@var_i', 23 | ["heels"] = 'move_f@heels@c', 24 | ["heels2"] = 'move_f@heels@d', 25 | ['hiking'] = 'move_m@hiking', 26 | ["quick"] = 'move_m@quick', 27 | ['wide'] = "move_m@bag", 28 | ["scared"] = 'move_f@scared', 29 | ["brave"] = 'move_m@brave', 30 | ["tipsy"] = 'move_m@drunk@slightlydrunk', 31 | ["injured"] = 'move_m@injured', 32 | ["tough"] = 'move_m@tough_guy@', 33 | ["sassy"] = 'move_m@sassy', 34 | ["sad"] = 'move_m@sad@a', 35 | ["posh"] = 'move_m@posh@', 36 | ["alien"] = 'move_m@alien', 37 | ["nonchalant"] = 'move_m@non_chalant', 38 | ["hobo"] = 'move_m@hobo@a', 39 | ["money"] = 'move_m@money', 40 | ["swagger"] = 'move_m@swagger', 41 | ["shady"] = 'move_m@shadyped@a', 42 | ["maneater"] = 'move_f@maneater', 43 | ["chichi"] = 'move_f@chichi', 44 | ["default"] = 'default', 45 | } -------------------------------------------------------------------------------- /client/walking.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | local walkstyle = 'default' 3 | local walktable = {} 4 | local walkpause = false 5 | 6 | RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function() 7 | Wait(2000) 8 | local PlayerData = QBCore.Functions.GetPlayerData() 9 | local savedwalk = GetResourceKvpString('walkstyles') 10 | if savedwalk then walktable = json.decode(savedwalk) end 11 | 12 | if walktable[PlayerData.citizenid] then 13 | walkstyle = walktable[PlayerData.citizenid] 14 | end 15 | end) 16 | 17 | RegisterNetEvent('ps-walks:walkpause', function() 18 | walkpause = not walkpause 19 | end) 20 | 21 | AddEventHandler('onResourceStart', function(resourceName) 22 | if GetCurrentResourceName() ~= resourceName then return end 23 | Wait(2000) 24 | local PlayerData = QBCore.Functions.GetPlayerData() 25 | local savedwalk = GetResourceKvpString('walkstyles') 26 | if savedwalk then walktable = json.decode(savedwalk) end 27 | 28 | if walktable[PlayerData.citizenid] then 29 | walkstyle = walktable[PlayerData.citizenid] 30 | end 31 | end) 32 | 33 | local function saveWalks() 34 | SetResourceKvp('walkstyles', json.encode(walktable)) 35 | end 36 | 37 | local function SetWalks(anim) 38 | local ped = PlayerPedId() 39 | if anim == 'default' then 40 | ResetPedMovementClipset(ped) 41 | ResetPedWeaponMovementClipset(ped) 42 | ResetPedStrafeClipset(ped) 43 | else 44 | RequestAnimSet(anim) 45 | while not HasAnimSetLoaded(anim) do Wait(0) end 46 | SetPedMovementClipset(ped, anim) 47 | ResetPedWeaponMovementClipset(ped) 48 | ResetPedStrafeClipset(ped) 49 | end 50 | end 51 | 52 | RegisterNetEvent('ps-walks:set', function(data) 53 | local anim = Config.WalkingSyles[data.id] 54 | walkstyle = anim 55 | SetWalks(anim) 56 | local PlayerData = QBCore.Functions.GetPlayerData() 57 | walktable[PlayerData.citizenid] = anim 58 | saveWalks() 59 | end) 60 | 61 | CreateThread(function() 62 | while true do 63 | Wait(1000) 64 | if not walkpause then 65 | local ped = PlayerPedId() 66 | local walkstyleCurrent = GetPedMovementClipset(ped) 67 | if walkstyleCurrent ~= joaat(walkstyle) or walkstyle == "default" then 68 | SetWalks(walkstyle) 69 | end 70 | end 71 | end 72 | end) 73 | 74 | CreateThread(function() 75 | local walkId = exports['qb-radialmenu']:AddOption({ 76 | id = 'walkstyles', 77 | title = 'Walkstyle', 78 | icon = 'person-walking', 79 | items = { 80 | { 81 | id = 'arrogant', 82 | title = 'Arrogant', 83 | icon = 'person-walking', 84 | type = 'client', 85 | event = 'ps-walks:set', 86 | shouldClose = true 87 | }, { 88 | id = 'casual', 89 | title = 'Casual', 90 | icon = 'person-walking', 91 | type = 'client', 92 | event = 'ps-walks:set', 93 | shouldClose = true 94 | }, { 95 | id = 'casual2', 96 | title = 'Casual 2', 97 | icon = 'person-walking', 98 | type = 'client', 99 | event = 'ps-walks:set', 100 | shouldClose = true 101 | }, { 102 | id = 'casual3', 103 | title = 'Casual 3', 104 | icon = 'person-walking', 105 | type = 'client', 106 | event = 'ps-walks:set', 107 | shouldClose = true 108 | }, { 109 | id = 'casual4', 110 | title = 'Casual4', 111 | icon = 'person-walking', 112 | type = 'client', 113 | event = 'ps-walks:set', 114 | shouldClose = true 115 | }, { 116 | id = 'casual5', 117 | title = 'Casual 5', 118 | icon = 'person-walking', 119 | type = 'client', 120 | event = 'ps-walks:set', 121 | shouldClose = true 122 | }, { 123 | id = 'casual6', 124 | title = 'Casual 6', 125 | icon = 'person-walking', 126 | type = 'client', 127 | event = 'ps-walks:set', 128 | shouldClose = true 129 | }, { 130 | id = 'morewalk', 131 | title = 'More Styles', 132 | icon = 'bars', 133 | items = { 134 | { 135 | id = 'confident', 136 | title = 'Confident', 137 | icon = 'person-walking', 138 | type = 'client', 139 | event = 'ps-walks:set', 140 | shouldClose = true 141 | }, { 142 | id = 'business', 143 | title = 'Business', 144 | icon = 'person-walking', 145 | type = 'client', 146 | event = 'ps-walks:set', 147 | shouldClose = true 148 | }, { 149 | id = 'business2', 150 | title = 'Business 2', 151 | icon = 'person-walking', 152 | type = 'client', 153 | event = 'ps-walks:set', 154 | shouldClose = true 155 | }, { 156 | id = 'business3', 157 | title = 'Business 3', 158 | icon = 'person-walking', 159 | type = 'client', 160 | event = 'ps-walks:set', 161 | shouldClose = true 162 | }, { 163 | id = 'femme', 164 | title = 'Femme', 165 | icon = 'person-walking', 166 | type = 'client', 167 | event = 'ps-walks:set', 168 | shouldClose = true 169 | }, { 170 | id = 'flee', 171 | title = 'Flee', 172 | icon = 'person-walking', 173 | type = 'client', 174 | event = 'ps-walks:set', 175 | shouldClose = true 176 | }, { 177 | id = 'muscle', 178 | title = 'Muscle', 179 | icon = 'person-walking', 180 | type = 'client', 181 | event = 'ps-walks:set', 182 | shouldClose = true 183 | }, { 184 | id = 'morewalk', 185 | title = 'More Styles', 186 | icon = 'bars', 187 | items = { 188 | -- 189 | { 190 | id = 'gangster', 191 | title = 'Gangster', 192 | icon = 'person-walking', 193 | type = 'client', 194 | event = 'ps-walks:set', 195 | shouldClose = true 196 | }, { 197 | id = 'gangster2', 198 | title = 'Gangster 2', 199 | icon = 'person-walking', 200 | type = 'client', 201 | event = 'ps-walks:set', 202 | shouldClose = true 203 | }, { 204 | id = 'gangster3', 205 | title = 'Gangster 3', 206 | icon = 'person-walking', 207 | type = 'client', 208 | event = 'ps-walks:set', 209 | shouldClose = true 210 | }, { 211 | id = 'gangster4', 212 | title = 'Gangster 4', 213 | icon = 'person-walking', 214 | type = 'client', 215 | event = 'ps-walks:set', 216 | shouldClose = true 217 | }, { 218 | id = 'gangster5', 219 | title = 'Gangster 5', 220 | icon = 'person-walking', 221 | type = 'client', 222 | event = 'ps-walks:set', 223 | shouldClose = true 224 | }, { 225 | id = 'heels', 226 | title = 'Heels', 227 | icon = 'person-walking', 228 | type = 'client', 229 | event = 'ps-walks:set', 230 | shouldClose = true 231 | }, { 232 | id = 'heels2', 233 | title = 'Heels 2', 234 | icon = 'person-walking', 235 | type = 'client', 236 | event = 'ps-walks:set', 237 | shouldClose = true 238 | }, { 239 | id = 'morewalk', 240 | title = 'More Styles', 241 | icon = 'bars', 242 | items = { 243 | -- 244 | { 245 | id = 'hiking', 246 | title = 'Hiking', 247 | icon = 'person-walking', 248 | type = 'client', 249 | event = 'ps-walks:set', 250 | shouldClose = true 251 | }, { 252 | id = 'quick', 253 | title = 'Quick', 254 | icon = 'person-walking', 255 | type = 'client', 256 | event = 'ps-walks:set', 257 | shouldClose = true 258 | }, { 259 | id = 'wide', 260 | title = 'Wide', 261 | icon = 'person-walking', 262 | type = 'client', 263 | event = 'ps-walks:set', 264 | shouldClose = true 265 | }, { 266 | id = 'scared', 267 | title = 'Scared', 268 | icon = 'person-walking', 269 | type = 'client', 270 | event = 'ps-walks:set', 271 | shouldClose = true 272 | }, { 273 | id = 'brave', 274 | title = 'Brave', 275 | icon = 'person-walking', 276 | type = 'client', 277 | event = 'ps-walks:set', 278 | shouldClose = true 279 | }, { 280 | id = 'tipsy', 281 | title = 'Tipsy', 282 | icon = 'person-walking', 283 | type = 'client', 284 | event = 'ps-walks:set', 285 | shouldClose = true 286 | }, { 287 | id = 'injured', 288 | title = 'Injured', 289 | icon = 'person-walking', 290 | type = 'client', 291 | event = 'ps-walks:set', 292 | shouldClose = true 293 | }, { 294 | id = 'morewalk', 295 | title = 'More Styles', 296 | icon = 'bars', 297 | items = { 298 | -- 299 | { 300 | id = 'tough', 301 | title = 'Tough', 302 | icon = 'person-walking', 303 | type = 'client', 304 | event = 'ps-walks:set', 305 | shouldClose = true 306 | }, { 307 | id = 'sassy', 308 | title = 'Sassy', 309 | icon = 'person-walking', 310 | type = 'client', 311 | event = 'ps-walks:set', 312 | shouldClose = true 313 | }, { 314 | id = 'sad', 315 | title = 'Sad', 316 | icon = 'person-walking', 317 | type = 'client', 318 | event = 'ps-walks:set', 319 | shouldClose = true 320 | }, { 321 | id = 'posh', 322 | title = 'Posh', 323 | icon = 'person-walking', 324 | type = 'client', 325 | event = 'ps-walks:set', 326 | shouldClose = true 327 | }, { 328 | id = 'alien', 329 | title = 'Alien', 330 | icon = 'person-walking', 331 | type = 'client', 332 | event = 'ps-walks:set', 333 | shouldClose = true 334 | }, { 335 | id = 'nonchalant', 336 | title = 'Nonchalant', 337 | icon = 'person-walking', 338 | type = 'client', 339 | event = 'ps-walks:set', 340 | shouldClose = true 341 | }, { 342 | id = 'hobo', 343 | title = 'Hobo', 344 | icon = 'person-walking', 345 | type = 'client', 346 | event = 'ps-walks:set', 347 | shouldClose = true 348 | }, { 349 | id = 'morewalk', 350 | title = 'More Styles', 351 | icon = 'bars', 352 | items = { 353 | -- 354 | { 355 | id = 'money', 356 | title = 'Money', 357 | icon = 'person-walking', 358 | type = 'client', 359 | event = 'ps-walks:set', 360 | shouldClose = true 361 | }, { 362 | id = 'swagger', 363 | title = 'Swagger', 364 | icon = 'person-walking', 365 | type = 'client', 366 | event = 'ps-walks:set', 367 | shouldClose = true 368 | }, { 369 | id = 'shady', 370 | title = 'Shady', 371 | icon = 'person-walking', 372 | type = 'client', 373 | event = 'ps-walks:set', 374 | shouldClose = true 375 | }, { 376 | id = 'maneater', 377 | title = 'Man Eater', 378 | icon = 'person-walking', 379 | type = 'client', 380 | event = 'ps-walks:set', 381 | shouldClose = true 382 | }, { 383 | id = 'chichi', 384 | title = 'Chichi', 385 | icon = 'person-walking', 386 | type = 'client', 387 | event = 'ps-walks:set', 388 | shouldClose = true 389 | }, { 390 | id = 'default', 391 | title = 'Default', 392 | icon = 'person-walking', 393 | type = 'client', 394 | event = 'ps-walks:set', 395 | shouldClose = true 396 | } 397 | } 398 | } 399 | } 400 | } 401 | } 402 | } 403 | } 404 | } 405 | } 406 | } 407 | } 408 | }) 409 | end) --------------------------------------------------------------------------------