Scripts / Script not working

Author
Message
vrg
9
Years of Service
User Offline
Joined: 27th Aug 2014
Location: Netherlands
Posted: 8th Dec 2023 23:15
What is wrong , it is not working, thanks

-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Switch with counter

local combiswitch = {}
function combiswitch_init(e)
CombiSwitch = 0
end

function combiswitch_main(e)
PlayerDist = GetPlayerDistance(e)
if CombiSwitch == 0 then
if PlayerDist < 200 and g_PlayerHealth > 0 then
Prompt("Press E key to activate combiswitch")
if g_KeyPressE == 1 then
CombiSwitch = 1
PromptDuration("CombiSwitch activated" ,3000)
CS=CS+1
if CS == 6 then Prompt("Game finished")
end
end
end
end
end

Laptop MSI Vector GP66 , I7 processor 12th Gen Intel(R) Core(TM) i7-12700H 2.70 GHz, Nvidia graphics RTX 3060, 16 Gb memory

Login to post a reply

Server time is: 2024-05-01 03:12:48
Your offset time is: 2024-05-01 03:12:48