- Initiateur de la discussion
Sueezen
Geek suprême
- Messages
- 451
- Score réaction
- 103
- Points
- 160
Bonjour, je vous explique je viens de créer une entité et j'aimerais que celle-ci ne flotte pas
comme ceci:
Voici mes fichiers:
comme ceci:
Voici mes fichiers:
Init.lua
Shared.luaAddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
util.AddNetworkString("AnonymousRollFrame")
util.AddNetworkString("AnonymousAction")
util.AddNetworkString("RollAction")
-- Côté Serveur
function ENT:SpawnFunction(ply, tr, classname)
if !tr.Hit then return end
local SpawnPos = tr.HitPos + tr.HitNormal * 16
local SpawnAng = ply:EyeAngles()
SpawnAng.p = 0
SpawnAng.y = SpawnAng.y + 180
local ent = ents.Create(classname)
ent:SetPos(SpawnPos)
ent:SetAngles( SpawnAng )
ent:Spawn()
ent:Activate()
return ent
end
function ENT:Use(act, ply)
if IsValid(ply) and ply:IsPlayer() then
net.Start("AnonymousRollFrame")
net.Send(ply)
end
end
net.Receive("AnonymousAction", function(len, ply)
local anomsg = net.ReadString()
for _, ply in pairs(player.GetAll()) do
ply:ChatPrint("[Anonyme] " .. anomsg)
end
end)
net.Receive("RollAction", function(len, ply)
local randomnumber = math.random(1, 100)
for _, ply in pairs(player.GetAll()) do
ply:ChatPrint("Le nombre est " .. randomnumber .. ".")
end
end)
ENT.Base = "base_ai"
ENT.Type = "anim"
ENT.PrintName = "NPC Anonymous Roll"
ENT.Category = "Sueezen Script"
ENT.Instructions = ""
ENT.Spawnable = true
function ENT:Initialize()
self:SetModel("models/gman.mdl")
self:SetSolid(SOLID_BBOX)
if SERVER then self:SetUseType(SIMPLE_USE) end
end