Hello guys ! =D
Fast Question. i download pointshop ! but i found something that i cant fix...
i bought gravity and work , i log out -rejoin the game and still with the low gravity upgrade... but when i bought super speed.. i just die once or log out and i loose the super speed :S what can be the problem guys ? thanks
here is the code of the super speed:
ITEM.Name = "Super Speed"
ITEM.Enabled = true
ITEM.Description = "Gives you super speed!"
ITEM.Cost = 200
ITEM.Model = "models/weapons/w_toolgun.mdl"
ITEM.Functions = {
OnGive = function(ply, item)
item.Hooks.PlayerSpawn(ply, item)
end,
OnTake = function(ply, item)
local oldWalk = ply.OldWalkSpeed or 250
local oldRun = ply.OldRunSpeed or 500
ply:SetWalkSpeed(oldWalk)
ply:SetRunSpeed(oldRun)
end
}
ITEM.Hooks = {
PlayerSpawn = function(ply, item)
if not ply.OldWalkSpeed and not ply.OldRunSpeed then
ply.OldWalkSpeed = ply:GetWalkSpeed()
ply.OldRunSpeed = ply:GetRunSpeed()
end
ply:SetWalkSpeed(500)
ply:SetRunSpeed(1000)
end
}
and here is the gravity code
ITEM.Name = "Low Gravity"
ITEM.Enabled = true
ITEM.Description = "Sets low gravity on yourself when you spawn."
ITEM.Cost = 200
ITEM.Model = "models/weapons/w_toolgun.mdl"
ITEM.Functions = {
OnGive = function(ply, item)
item.Hooks.PlayerSpawn(ply, item)
end,
OnTake = function(ply, item)
local grav = ply.OldGravity or 1
ply:SetGravity(grav)
end
}
ITEM.Hooks = {
PlayerSpawn = function(ply, item)
if not ply.OldGravity then
ply.OldGravity = ply:GetGravity()
end
ply:SetGravity(0.3)
end
}
thanks ! =D