I have done every single code on this site. I put the lua in the autorun file and yet I'm still not having any luck with it.
local SourceSkyname = GetConVar("sv_skyname"):GetString() --We need the source of the maps original skybox texture so we can manipulate it.
local SourceSkyPre = {"lf","ft","rt","bk","dn","up",}
local SourceSkyMat = {
Material("skybox/"..sky_rainbow_01.."lf"),
Material("skybox/"..sky_rainbow_01.."ft"),
Material("skybox/"..sky_rainbow_01.."rt"),
Material("skybox/"..sky_rainbow_01.."bk"),
Material("skybox/"..sky_rainbow_01.."dn"),
Material("skybox/"..sky_rainbow_01.."up"),
}
function ChangeSkybox(sky_rainbow_01)
for i = 1,6 do
local D = Material("skybox/"..skyboxname..SourceSkyPre[i]):GetMaterialTexture("$basetexture")
SourceSkyMat[i]:SetMaterialTexture("$basetexture",D)
end
end
I used this code that everyone says works and I'm not having any luck on it. Can anyone tell me what is wrong?
Do you get any Lua errors?
Yes I do
[editline]30th April 2014[/editline]
PS: I also do the sv_skyname <skyname> and I restart it but all that happens when I reload is the map just resets and uses the original map name.
Is there something else I need to add?
Whats the error you get?
[QUOTE=djjkxbox360;44683149]Whats the error you get?[/QUOTE]
While the game is loading the game just states that something is causing script errors. But when the map loads it just loads the normal skybox that the map usually comes with. Like Badlands just spawns with the Badlands skybox texture even though I set the skyname to the Halloween Harvest Skybox texture.
The actual error is in the console, it will tell you what part of your code is wrong
Sorry, you need to Log In to post a reply to this thread.