Okay i am redoing the code for TF2 Style RTD [url]http://www.facepunch.com/threads/941818-TF2-Style-RTD(roll-the-dice)-Script?p=30648014#post30648014[/url] but i am now running into issusing with it not loading up at all! Here is my code...
[LUA] /*
New Code Author: [MK] MadkillerMax
AUTHOR: Wesnc
CREDITS:MakeR, |Flapjack|, Ram
TODO:
(5-28-2010)Fix blind command
(5-28-2010)add drug command
*/
include("autorun/server/addtextex.lua")
AddCSLuaFile("autorun/server/addtextex.lua")
AddCSLuaFile("autorun/client/cl_rtd.lua")
local frags = CreateConVar("rtd_roll_frags", 1337)
local name = CreateConVar("rtd_roll_name", "Cookies")
local maxrolls = CreateConVar("rtd_rolls_max", 1) --max rolls
local rollintervaltime = CreateConVar("rtd_rolls_intervaltime", 200) --interval between rolls in seconds
local spawnprotect = CreateConVar("rtd_sp_enable", 0) -- off by default, requires the spawn protection script by me
local chatcommand = CreateConVar("rtd_roll_saycommand", "!rtd")
local dice = {} -- Things with methods need to be global
local health = math.random(50,200)
local frags = frags:GetInt()
local name = name:GetString()
local duration = math.random(10,40)
local armor = math.random(50,200)
local pay = math.random(50,300)
timer.Create( "rtd_advert", 120, 0, function()
<SPAN class=highlight>chat.AddText</SPAN>([ Player ply,] (Color(0,0,128), "[RTD]: ", (Color(255,255,255), "Type rtd or !rtd to gamble!".."\n")
end )
dice.outcomes = {
Ignite = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." has been ignited for "..duration.." seconds")
ply:Ignite(duration, 0)
ply:SetColor(255, 0, 0, 255)
timer.Simple(duration, function(ply)
ply:SetColor(255, 255, 255, 255)
end, ply)
end ,
Moneygive = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." has found $"..pay.." money!")
RunConsoleCommand("ps_givepoints "..ply:Nick().." "..pay)
end,
Moneytake = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got his money was stolen, he lost $"..pay.." money!")
RunConsoleCommand("ps_takepoints "..ply:Nick().." "..pay)
end,
Kill = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." has been killed!")
ply:Kill()
end ,
Colors = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got their color changed!")
ply:SetColor(math.Rand(0, 255), math.Rand(0, 255), math.Rand(0, 255), 255)
end ,
Nothing = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got jack shit!")
end ,
Health = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got their health added by "..health)
ply:SetHealth(ply:Health()+health)
end ,
Frags = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got their frags set to "..frags.."!")
ply:SetFrags(frags)
end ,
Freeze = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got frozen for "..duration.." seconds!")
ply:Freeze(true)
ply:SetColor(0, 0, 255, 255)
ply:EmitSound("physics/glass/glass_sheet_break1.wav")
timer.Simple(duration, function(ply)
ply:Freeze(false)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got unfrozen!")
ply:SetColor(255, 255, 255, 255)
end, ply)
end,
Strip = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got stripped of all their weapons!")
ply:StripWeapons()
ply:Give("weapon_crowbar")
end,
Ragdoll = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got ragdoll'd for "..duration.." seconds!")
local ent = ents.Create("prop_ragdoll")
ent:SetPos(ply:GetPos())
ent:SetAngles(ply:GetAngles())
ent:SetModel(ply:GetModel())
ent:Spawn()
ent:Activate()
ent:SetColor(255, 255, 25, 255)
ply:SetParent(ent)
ply:Spectate(OBS_MODE_CHASE)
ply:SpectateEntity(ent)
ply:StripWeapons()
timer.Simple(duration, function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got unragdoll'd")
ply:SetParent()
ply:Spawn()
entpos = ent:GetPos()
entpos.z = entpos.z + 75
ply:SetPos(entpos)
ent:Remove()
end, ply)
end,
Rocket = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got shot the fuck up and exploded")
if ply:GetMoveType() == MOVETYPE_NOCLIP then
ply:SetMoveType(MOVETYPE_WALK)
end
ply:SetVelocity(Vector(0, 0, 9999))
timer.Simple(3, function(ply)
local exp = ents.Create("env_explosion")
exp:SetPos(ply:GetPos())
exp:Spawn()
exp:Fire("Explode", 0, 0)
ply:KillSilent()
//ply:KillSilent()
end, ply)
end ,
Name = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got their name changed to "..name.."!")
ply:SetName(name)
end ,
Crush = function(ply)
if ply:GetMoveType() == MOVETYPE_NOCLIP then
ply:SetMoveType(MOVETYPE_WALK)
end
ply:Freeze(true)
ply:GodDisable()
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got fucking crushed!")
local models = {
"models/props_c17/FurnitureWashingmachine001a.mdl",
"models/Cliffs/rockcluster02.mdl",
"models/props_wasteland/rockcliff_cluster02a.mdl",
"models/props_wasteland/rockcliff05f.mdl",
"models/props_wasteland/rockcliff_cluster03c.mdl",
"models/props_foliage/rock_coast02h.mdl",
"models/props_junk/TrashDumpster02.mdl",
"models/props_wasteland/cargo_container01.mdl",
"models/props_wasteland/laundry_dryer002.mdl",
"models/props_foliage/rock_coast02h.mdl"}
local entc = ents.Create("prop_physics")
entc:SetModel(table.Random(models))
entc:SetPos(ply:GetPos()+Vector(0, 0, 500))
entc:Spawn()
phys = entc:GetPhysicsObject()
phys:SetMass(999)
entc:SetVelocity(Vector(0, 0, -999))
timer.Simple(6, function(ply)
entc:Remove()
ply:Freeze(false)
ply:Kill()
end, ply)
end,
Invis = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got invisable for "..duration.." seconds!")
ply:SetColor(0, 0, 0, 0)
timer.Simple(duration, function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got visable again!")
chat.PlaySound()
ply:SetColor(255, 255, 255, 255)
end, ply)
end,
Godmode = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got godmoded for "..duration.." seconds!")
ply:GodEnable()
timer.Simple(duration, function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got ungodmodededed!")
ply:GodDisable()
end, ply)
end ,
Scream = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got screamed at!")
ply:EmitSound("npc/fast_zombie/fz_scream1.wav", 500, 20)
ply:EmitSound("npc/fast_zombie/fz_scream1.wav", 500, 30)
ply:EmitSound("npc/fast_zombie/fz_scream1.wav", 500, 40)
ply:EmitSound("npc/fast_zombie/fz_scream1.wav", 500, 50)
ply:EmitSound("npc/fast_zombie/fz_scream1.wav", 500, 60)
ply:EmitSound("npc/fast_zombie/fz_scream1.wav", 500, 70)
ply:EmitSound("npc/fast_zombie/fz_scream1.wav", 500, 80)
ply:EmitSound("npc/fast_zombie/fz_scream1.wav", 500, 90)
end ,
Jail = function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got jailed for "..duration.." seconds!")
ply:Freeze(false)
ply:SetColor(255, 0, 0, 255)
jail = ents.Create("prop_physics")
jail:SetModel("models/props_junk/TrashDumpster02.mdl")
jail:SetPos(ply:GetPos()+Vector(0, 0, 150))
jail:SetAngles(Angle(0, 0, 180))
jail:SetMoveType(MOVETYPE_NONE)
jail:Freeze(true)
jail:Spawn()
jail:Activate()
jail:SetColor(255, 0, 0, 100)
timer.Simple(duration, function(ply)
PrintMessage(HUD_PRINTTALK, "[RTD] "..ply:Nick().." got unjailed!")
ply:Freeze(false)
ply:SetColor(255, 255, 255, 255)
jail
That the serverside file?
I think you're starting on the bones of the old script. Better start from scratch.
Yes this is the serverside and, really? You think i should start this entire code from scratch?
[QUOTE=MadkillerMax;30656739]Yes this is the serverside and, really? You think i should start this entire code from scratch?[/QUOTE]
Yes. It would be great practice.
Well then, off i go into the world of a crap load of typing!
Sorry, you need to Log In to post a reply to this thread.