Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dev01-cls
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zero
dev01-cls
Commits
a8c347bf
Commit
a8c347bf
authored
Aug 08, 2025
by
zero
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
de95188a
Pipeline
#39
canceled with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
sh_entity.lua
sh_entity.lua
+70
-0
No files found.
sh_entity.lua
0 → 100644
View file @
a8c347bf
-- Entidad para el plugin HogwartsRP Clases
-- Define la entidad ix_pergamino_test para interactuar con pergaminos físicos.
ENT
=
{}
ENT
.
Type
=
"anim"
ENT
.
Base
=
"base_gmodentity"
ENT
.
PrintName
=
"Pergamino de Test"
ENT
.
Category
=
"HogwartsRP"
ENT
.
Spawnable
=
true
ENT
.
AdminOnly
=
true
function
ENT
:
Initialize
()
local
CONFIG
=
ix
.
clases
.
CONFIG
self
:
SetModel
(
ix
.
config
.
Get
(
"HogwartsRP_PergaminoModel"
))
self
:
PhysicsInit
(
SOLID_VPHYSICS
)
self
:
SetMoveType
(
MOVETYPE_VPHYSICS
)
self
:
SetSolid
(
SOLID_VPHYSICS
)
local
phys
=
self
:
GetPhysicsObject
()
if
IsValid
(
phys
)
then
phys
:
Wake
()
phys
:
EnableMotion
(
false
)
end
end
function
ENT
:
Use
(
activator
)
local
CONFIG
=
ix
.
clases
.
CONFIG
if
not
activator
:
IsPlayer
()
then
return
end
local
char
=
activator
:
GetCharacter
()
if
not
char
then
return
end
local
studentFactionUniqueID
=
ix
.
faction
.
Get
(
char
:
GetFaction
()).
uniqueID
if
not
table
.
HasValue
(
CONFIG
.
FACTIONS_ESTUDIANTES
,
studentFactionUniqueID
)
then
activator
:
Notify
(
"¡Solo los estudiantes de las cuatro casas pueden usar esto!"
)
return
end
local
test
=
ix
.
tests
[
self
.
testID
]
if
not
test
then
activator
:
Notify
(
"¡Test no encontrado!"
)
return
end
local
clasesCompletadas
=
char
:
GetData
(
"clasesCompletadas"
,
{})
if
clasesCompletadas
[
self
.
testID
]
then
activator
:
Notify
(
"¡Ya has tomado este test!"
)
return
end
if
SERVER
then
local
effect
=
EffectData
()
effect
:
SetOrigin
(
self
:
GetPos
())
effect
:
SetMagnitude
(
1
)
effect
:
SetScale
(
1
)
effect
:
SetRadius
(
1
)
util
.
Effect
(
"Sparks"
,
effect
)
end
net
.
Start
(
"HogwartsRP_IniciarTest"
)
net
.
WriteUInt
(
self
.
testID
,
32
)
net
.
WriteString
(
test
.
hechizo
)
net
.
WriteUInt
(
test
.
experiencia
,
16
)
net
.
WriteString
(
test
.
clase
)
net
.
WriteTable
(
test
.
preguntas
)
net
.
Send
(
activator
)
test
.
estudiantes
[
activator
]
=
{
respuestas
=
{},
puntaje
=
0
}
end
scripted_ents
.
Register
(
ENT
,
"ix_pergamino_test"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment