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

How do I change the color of the fog created by ninja blink potion?

Asked by 11 years ago

local Tool = script.Parent local vChar = nil local torso = nil

local maxRange = 100

local lowerBound = nil local upperBound = nil

local debris = game:GetService("Debris") local r = game:GetService("RunService")

local blinkSound = Tool.Blink

function onEquipped() torso = nil vChar = Tool.Parent if vChar ~= nil then torso = vChar:FindFirstChild("Torso") end end

Tool.Enabled = true

function getAABB() local torsoXAxis = torso.CFrame:vectorToWorldSpace(Vector3.new(1, 0, 0)).unit local torsoYAxis = torso.CFrame:vectorToWorldSpace(Vector3.new(0, 1, 0)).unit local torsoZAxis = torso.CFrame:vectorToWorldSpace(Vector3.new(0, 0, 1)).unit lowerBound = nil upperBound = nil -- create bounding box for blinking charChildren = vChar:GetChildren() for i = 1, #charChildren do local handle = nil if charChildren[i].className == "Hat" or charChildren[i].className == "Tool" then handle = charChildren[i]:FindFirstChild("Handle") elseif charChildren[i].className == "Part" then handle = charChildren[i] end if handle ~= nil then lowCornerTC = handle.CFrame:vectorToWorldSpace(-handle.Size / 2) + handle.Position - torso.Position highCornerTC = handle.CFrame:vectorToWorldSpace(handle.Size / 2) + handle.Position - torso.Position if lowerBound == nil then lowerBound = lowCornerTC end if upperBound == nil then upperBound = highCornerTC end lowerBound = Vector3.new(math.min(lowerBound.X, lowCornerTC.X), math.min(lowerBound.Y, lowCornerTC.Y), math.min(lowerBound.Z, lowCornerTC.Z)) upperBound = Vector3.new(math.max(upperBound.X, lowCornerTC.X), math.max(upperBound.Y, lowCornerTC.Y), math.max(upperBound.Z, lowCornerTC.Z)) lowerBound = Vector3.new(math.min(lowerBound.X, highCornerTC.X), math.min(lowerBound.Y, highCornerTC.Y), math.min(lowerBound.Z, highCornerTC.Z)) upperBound = Vector3.new(math.max(upperBound.X, highCornerTC.X), math.max(upperBound.Y, highCornerTC.Y), math.max(upperBound.Z, highCornerTC.Z)) end end end

function onActivated() if not Tool.Enabled then return end if torso == nil or vChar == nil then return end local head = vChar:FindFirstChild("Head") if head then local torsoPos = torso.Position local headPos = head.Position hum = vChar:FindFirstChild("Humanoid") if hum == nil then return end Tool.Enabled = false getAABB() print(lowerBound) print(upperBound) hum.WalkSpeed = 0 --hum.Jump = true

01    local newBG = torso:FindFirstChild("TinyFloat")
02    if newBG == nil then
03        newBG = Instance.new("BodyPosition")
04        newBG.position = torso.Position + Vector3.new(0, 0.5, 0)
05        newBG.P = 1000000
06        newBG.maxForce = Vector3.new(0, newBG.P, 0)
07        newBG.Name = "TinyFloat"
08        newBG.Parent = torso
09    end
10 
11    -- changed torsoPos for headPos here...
12    local teleportSpot = hum.TargetPoint * Vector3.new(1, 0, 1) + Vector3.new(0, headPos.Y, 0)
13    local teleportDir = (teleportSpot - headPos).unit
14        --local highTeleportSpot = teleportSpot + Vector3.new(0, (upperBound.Y - lowerBound.Y)/2, 0)  -- allow for slight height gain in blinking
15 
View all 89 lines...

end

Tool.Equipped:connect(onEquipped) Tool.Activated:connect(onActivated)

Where would I change the script to make the color green? Please send me updated script and how you did it so I can learn... thanks a ton!!!

0
Thank you so much, this really helped, I cant believe I didn't realize it was on a RGB scale.... Thanks!! pigpoop187 10 — 11y

4 answers

Log in to vote
2
Answered by 11 years ago

You need to change the following:

1smoke.Color = Color3.new(5,0,5)
2-- to
3smoke.Color = Color3.new(0, 1, 0)

and

1smoke2.Color = Color3.new(5,0,5)
2-- to
3smoke2.Color = Color3.new(0, 1, 0)

This is because Color3 values use RGB values (red, green and blue). So changing the value to (0, 1, 0) makes the colour green.

Ad
Log in to vote
0
Answered by
Bebee2 195
11 years ago

Alright, in the script, you see local smoke = Instance.new("Smoke") and smoke2 = Instance.new("Smoke")?

Set the "Color" property to Color3.new(0,255/255,0) like

1smoke.Color = Color3.new(0,255/255,0)
Log in to vote
0
Answered by 11 years ago

when the smoke is created, you can change the color (5, 0, 5). I believe it's based on a RGB color scale.

Log in to vote
0
Answered by 11 years ago
01local smoke = Instance.new("Smoke")
02smoke.Name = "smoke"
03smoke.Color = Color3.new(5,0,5)
04smoke.Opacity = .9
05smoke.RiseVelocity = 2
06smoke.Parent = smoker
07 
08local smoke2 = Instance.new("Smoke")
09smoke2.Name = "smoke2"
10smoke2.Color = Color3.new(5, 0, 5)
11smoke2.Opacity = .8
12smoke2.RiseVelocity = 3
13smoke2.Parent = smoker

In the script, you will see

1smoke.Color = Color3.new(5,0,5)

In order for you to change the color of it, please change the (5,0,5) to any combination like (0,5,0). 0.5.0 is Green, and the color code is in a RGB order. If it were to be (5,0,0) it would be Red.

1smoke.Color = Color3.new(5,0,0)

That makes the color of the smoke Red.

You must also change

1smoke2.Color = Color3.new(5, 0, 5)

to

1smoke2.Color = Color3.new(5, 0, 0)

Well, of course you don't have to have the same smoke colors. Have a little play around with it, and make cool smoke effects, like.. Red and Blue mixed together.

Have any other questions, please PM me on ROBLOX. My Username is DurstAuric.

Answer this question