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

How to make Change sky on Touch Part and back original sky on stop touch?

Asked by 3 years ago
Edited 3 years ago

Someone how to make Change skybox on touch part? I need to make my game. And get back sky on stop touching.

1 answer

Log in to vote
0
Answered by 3 years ago

first, you will need a touch script so the script can activate when you touch it

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("HumanoidRootPart") then

you can use this to find if the item touching the part is a real thing

then you can create a new skybox using instance.new

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("HumanoidRootPart") then
        local skybox = Instance.new("Sky")
        skybox.Parent = game.Lighting
        --add textures below
    end
end)

you can add the skybox textures yourself next

0
thanks gta_12344567890 7 — 3y
0
np NeonPandaEyes331 21 — 3y
0
after stop on touch sky change back? gta_12344567890 7 — 3y
0
you can make a while loop for that, for example while(hit.Parent:FindFirstChild("HumanoidRootPart") do NeonPandaEyes331 21 — 3y
0
could you also tell me which script to change sky value after entering the planet for example. Im creating space game with planets, everything else, I wanted to know which script changes the sky after entering a planet, as if it were an atmosphere transition. gta_12344567890 7 — 3y
Ad

Answer this question