Hi, How can I : ply:SetPos into a shared file (Its not possible I know but, do I need to use a net.start or how do I do ?)
Here's My code
[CODE]
if ply:IsDonator() then
break
elseif !ply:IsDonator() then
ply:EmitSound( "vo/npc/male01/gethellout.wav", 100, 100 )
--ply:SetPos-- (The Setpos)
notification.AddLegacy( "Sorry you are not a VIP, please consider donating.", NOTIFY_ERROR, 5 )
surface.PlaySound( "buttons/button15.wav" )
Msg( "Sorry you are not a VIP, please consider donating.\n" )
end
[CODE]
[highlight](User was banned for this post ("Undescriptive thread title, learn to use code tags" - postal))[/highlight]
End your tags with [/code], thanks!
also just ply:SetPos(Vector(0,0,0)) should work fine there
In the shared side
what
[editline]13th October 2015[/editline]
OH, I think I know what mean
Just something like this might work:
[code]
if SERVER then
--code here
[/code]
Humm... What I need is something that I can add that will set the player position but the problem is that it is called in the shared file so hwo do I do ?
[QUOTE=DJlive34;48895067]Humm... What I need is something that I can add that will set the player position but the problem is that it is called in the shared file so hwo do I do ?[/QUOTE]
If it's shared, that means it gets run CLIENTSIDE and SERVERSIDE, so what Niandra means (I think) is that if you do a simple check to see whether it's running on client or server before setting the player's position, it should work. Player:SetPos only works serverside (I added this to the entity:SetPos bit of the wiki a while ago)
If your script is in a function the example below may not work if your function needs parts to run clientside/serverside, but:
[CODE]
if SERVER then
if ply:IsDonator() then
break
elseif !ply:IsDonator() then
ply:EmitSound( "vo/npc/male01/gethellout.wav", 100, 100 )
ply:SetPos(--the pos)
notification.AddLegacy( "Sorry you are not a VIP, please consider donating.", NOTIFY_ERROR, 5 )
surface.PlaySound( "buttons/button15.wav" )
Msg( "Sorry you are not a VIP, please consider donating.\n" )
end
end
[/CODE]
By the way, where it says 'break' in your code, is that actually there in the original code of yours? If not, you don't need to do an elseif statement, just an 'if' statement.
My files are like that :
Garrysmod\addons\myscript\myscript\(There's a client file in this folder)sh_myscript.lua
Will the if SERVER syntax work ? You think ?
By the way thanks :D
Does it work if you test it?
I might be wrong, but perhaps your thing should be
Garrysmod\addons\myscript\autorun
Since autorun is run on client AND server (I think)
I will try this evening I'll tel you
[QUOTE=DJlive34;48895015]
Here's My code
[lua]
if ply:IsDonator() then
break
elseif !ply:IsDonator() then
ply:EmitSound( "vo/npc/male01/gethellout.wav", 100, 100 )
--ply:SetPos-- (The Setpos)
notification.AddLegacy( "Sorry you are not a VIP, please consider donating.", NOTIFY_ERROR, 5 )
surface.PlaySound( "buttons/button15.wav" )
Msg( "Sorry you are not a VIP, please consider donating.\n" )
end
[/lua][/QUOTE]
Your code?
This is my code from my Multiple Custom Zone Script...
What exactly are you trying to do?
You could just open a ticket on Scriptfodder with me.
Edit: Actually this looks more like the one included in Underdone RPG.
It's n,ot my code iy's your code mate xD
Your the only one that noticed
[editline]16th October 2015[/editline]
Well don't call me stupid please but xD
To train, I delete some lines in some addons and then, I try to fix them so when I have a problem with the script I ask there sorry, I trust you don't worry By the way thanks for your answer on my other thread
Sorry, you need to Log In to post a reply to this thread.