generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Blurry vision underwater

Previous Thread :: Next Thread 
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 Mar 2014 05:27 PM
How would I go about making a person's vision blurry when they go underwater? I have a GUI that makes the player's vision blurry, but I'm not sure how I would go about putting it on the player nor detecting when the player is above or below the water.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
30 Mar 2014 05:28 PM
Find the altitude of the water (Y Axis in Position), then put a loop on them so that whenever it goes below that altitude, pop the GUI up.
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 Mar 2014 05:30 PM
Yeah; I've tried this already -- It never pops up. Here's the script that I put in the water itself:
script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") then
if hit.Parent.Head.CFrame.Y<=script.Parent.CFrame.Y then
p=game.Players:GetPlayerFromCharacter(hit.Parent)
u=game.ReplicatedStorage.Underwater:Clone()
u.Parent=p.PlayerGui
wait(0.5)
elseif hit.Parent.Head.CFrame.Y>script.Parent.CFrame.Y then
for i,v in pairs(p.PlayerGui:GetChildren()) do
if v.Name=="Underwater" then
v:Destroy()
end
end
end
end
end)
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 Mar 2014 05:30 PM
I gave up trying to put it in the player.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
30 Mar 2014 05:31 PM
May I ask what kind of water this is? Roblox Terrain or normal water?
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 Mar 2014 05:32 PM
Neither; it's a part (0.2 in height, somewhat large x/y). If you've ever played Everquest before, I'm trying to replicate the effects underwater.
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
30 Mar 2014 05:32 PM
region3 use
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 Mar 2014 05:34 PM
No. Those bricks are terribly annoying, and I don't want my water to look like that.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
30 Mar 2014 05:34 PM
I've never played everquest, but I'm guessing you want it to blur out whenever your eyes/head on roblox go underwater?
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 Mar 2014 05:35 PM
Yes; I'm putting a GUI in the player's PlayerGui to blur out their vision whenever they're underwater and when they come up, the GUI is removed.
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
30 Mar 2014 05:39 PM
player=game.Players.Player1
pc=player.Character
h=pc.Head

while wait() do
if h.Position.Y>ALTITUDEOFWATERHERE then
game.StarterGui.GUINAME.Parent=player.PlayerGui
else
if player.PlayerGui:findFirstChild('GUINAME') then
player.PlayerGui.GUINAME.Parent=game.StarterGui
else
print'lol'
end
end
end

Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 Mar 2014 05:41 PM
..Uh, I'm gonna guess this goes in a localscript in the player.
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 Mar 2014 06:04 PM
Took quite alot of editing; but I got it. It's suited for my game particularly, but here's the edited and working script:
player=game.Players.LocalPlayer
pc=player.Character
h=pc.Head

while wait(0.5) do
if h.Position.Y<51 and not player.PlayerGui:findFirstChild("Underwater")then
u=game.ReplicatedStorage.Underwater:clone()
u.Parent=player.PlayerGui
elseif player.PlayerGui:findFirstChild("Underwater") and h.Position.Y<51 then
-- Do nothing
elseif player.PlayerGui:findFirstChild("Underwater") and h.Position.Y>51 then
for i,v in pairs(player.PlayerGui:GetChildren()) do
if v.Name=="Underwater" then v:Destroy() end
end
end
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image