[RELEASE] [ESX] Diamond Casino Lucky Wheel

Did you fix that?

Nope not yet

I fixed this last night. I can post the code later on tonight. However I did convert this to vrp so I dont remember how much code is still the same to the original.

can you poste thw spinning wheel correction

This is the doRoll event, not the function but the event.

_isRolling = true
	SetEntityHeading(_wheel, -30.9754)
    Citizen.CreateThread(function()
        local speedIntCnt = 1
        local rollspeed = 1.0
        local _winAngle = (_priceIndex - 1) * 18
        local _rollAngle = _winAngle + (360 * 8)
        local _midLength = (_rollAngle / 2)
        local intCnt = 0
        while speedIntCnt > 0 do
            local retval = GetEntityRotation(_wheel, 1)
            if _rollAngle > _midLength then
                speedIntCnt = speedIntCnt + 1
            else
                speedIntCnt = speedIntCnt - 1
                if speedIntCnt < 0 then
                    speedIntCnt = 0
                    
                end
            end
            intCnt = intCnt + 1
            rollspeed = speedIntCnt / 10
            local _y = retval.y - rollspeed
            _rollAngle = _rollAngle - rollspeed
			SetEntityHeading(_wheel, -30.9754)
            SetEntityRotation(_wheel, 0.0, _y, -30.9754, 2, true)
            Citizen.Wait(5)
        end
    end)
9 Likes

Thanks, now working perfect!

2 Likes

I’m glad it helped :slight_smile:

Thanks

1 Like

thanks so much bud tried and tried, so Glad you figured it out, and shared it

now just gotta figure out a way for rewards to sync with wheel stop target

Hello, I’m looking for the ID for the doors for diamond casino, but I can’t find them. Could someone send me the doors?

Did you figure out a way to sync the rewards with the wheel??:slightly_smiling_face:

nope still tinkering with it

is there a way to make it so only the person who spun the wheel get the notification instead of the whole server?

Yeah, just use source instead of -1

Actually it’s _source

Look at my post here:

1 Like

Using CreateVehicle will spawn a vehicle for every client and they will all see it.

Use ESX.Game.SpawnLocalVehicle instead.

if i’m changing only the createvehicle to ESX.Game.SpawnLocalVehicle there no more vehicle.

Make sure you have correct vehicle model name

i make only this change

local vehicle =  ESX.Game.SpawnLocalVehicle(carmodel, 963.41, 47.829, 74.57, 92.5, false, false)

and i changed all the Lambo name in it.