Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

1 answer

✓ Accepted answer

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

5 comments

0

thanks

0

np

0

after stop on touch sky change back?

0

you can make a while loop for that, for example while(hit.Parent:FindFirstChild("HumanoidRootPart") do

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.