Funktionierende Schranke in Roblox Studio bauen?

1 Antwort

Bild:

Bild zum Beitrag

Script ( ich hab das ganz schnell gemacht, also es ist nicht sehr gut ):

local Part = script.Parent:WaitForChild("Part2")
local TS = game:GetService("TweenService")


local ClosedPos = Vector3.new(3.55, 5.022, -23.422)
local ClosedOrientation = Vector3.new(-90, 0, 0)
local OpenPos = Vector3.new(3.55, 10.222, -18.222)
local Openorientation = Vector3.new(0, 0, 0)


local Hitbox = script.Parent:WaitForChild("Hitbox")


local function Open()
	
	TS:Create(Part, TweenInfo.new(2, Enum.EasingStyle.Sine), {Position = OpenPos, Orientation = Openorientation}):Play()
	
end


local function Close()
	
	TS:Create(Part, TweenInfo.new(2, Enum.EasingStyle.Sine), {Position = ClosedPos, Orientation = ClosedOrientation}):Play()
	
end










Hitbox.Touched:Connect(function(hit)
	
	if hit.Parent:FindFirstChild("Humanoid") then
		
		Open()
		
	end
	
end)


Hitbox.TouchEnded:Connect(function(hit)
	
	if hit.Parent:FindFirstChild("Humanoid") then
		
		Close()
		
	end
	
end)
Woher ich das weiß:Hobby – Programmiere spiele seit 2018
 - (Script, Robloxstudio, luau)

LSA88 
Beitragsersteller
 08.09.2024, 16:57

Vielen Dank für die Hilfe