QuickShot010 Posted January 30, 2015 Share Posted January 30, 2015 Okay, so i want my buildable prefab to emit light, only in caves, and only during day time.I tried coding it but for some reason the day things doesnt work. The cave only seems to be working. local light = inst.entity:AddLight() if GetWorld():IsCave() and GetClock():IsDay() then light:SetFalloff(0.5) light:SetIntensity(.8) light:SetRadius(2) light:SetColour(237/255, 237/255, 209/255) light:Enable(true) endAny ideas how to do the day only script? Link to comment https://forums.kleientertainment.com/forums/topic/50015-prefab-lights/ Share on other sites More sharing options...
seronis Posted January 30, 2015 Share Posted January 30, 2015 Exact same way that other posters are recently asking about doing things only during the rain. You listen for the proper events and react accordingly. Link to comment https://forums.kleientertainment.com/forums/topic/50015-prefab-lights/#findComment-607921 Share on other sites More sharing options...
Mobbstar Posted January 31, 2015 Share Posted January 31, 2015 you are checking for whether it's day only when the if clause fires, since you are adding light in the code snippet I assume that is when the prefab loads. As seronis suggested, listen for the daytime and dusktime events, to toggle light with those too (ideally make turnon/turnoff functions). Link to comment https://forums.kleientertainment.com/forums/topic/50015-prefab-lights/#findComment-608056 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now