Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

change fog distance upon touching a brick?

Asked by
nicros 165
8 years ago

so im making an RPG and i know pretty much nothing about lua :/ using free scripts form model shop and i found this for fog/view distance

if true then
game.Lighting.FogEnd = ("1000")
end

works perfect but how can i make it change for somone when they touch a brick.

to set the scene i have a desert level so i want the fog set at 1000 but when they enter my swampy level is there a way so when they touch a brick it sets their fog to say 250? so that it simulates a swampy foggy hardish to see landscape

sorry for not knowing much :/

1
Watching a tutorial for creating an ontouched brick would be a good place to start learning lua. (This is a beginner script) magiccube3 115 — 8y

2 answers

Log in to vote
0
Answered by
nicros 165
8 years ago

ok update......i now have this script attached to a basic brick as a place holder....

function onTouched(hit)
game.Lighting.FogEnd = ("1000")
end
script.Parent.Touched:connect(onTouched)

it works fine but correct me if im wrong...but wouldnt this when touched change the fog for EVERYONE?

how would i localize this script to make it change the fog for just the guy who touched it? so somone in my desert level sees at 1000 and the guy in the swamp sees 250?

0
Maybe if filtering's enabled and you change it with a localscript? That might be completely wrong though, I've never heard of someone wanting this.. magiccube3 115 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

put that in a local script.

0
would i just attach a local script to the brick and paste my current code in as is? or does something need to be added to the local script? nicros 165 — 8y

Answer this question