Quick actions

cmd+k|ctrl+k

Navigation

Languages

props_thumper

Snippet info

Language

Lua

Visibility

public

Author

zen

Created

2024-01-07T13:20:27.957988Z

Updated

2024-01-07T14:17:56.288358Z


local character: Model = owner.Character or owner.CharacterAdded:Wait()
local humanoid: Humanoid = character:WaitForChild("Humanoid")

local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {character}
raycastParams.FilterType = Enum.RaycastFilterType.Exclude

local assets = LoadAssets(15906066187)
local thumper: Model = assets:Get("Thumper"):Clone()

thumper.Parent = workspace

local raycast = workspace:Raycast(humanoid.RootPart.Position,Vector3.new(0,-100,0))

if raycast then
	thumper:PivotTo(CFrame.new(raycast.Position) * CFrame.Angles(math.rad(90),0,0))
else
	thumper:PivotTo(CFrame.new(humanoid.RootPart.Position - Vector3.new(0,3,0)) * CFrame.Angles(math.rad(90),0,0))
end

NS([==[
local KSP = loadstring(game:GetService("HttpService"):GetAsync("https://glot.io/snippets/gs2b7nwhij/raw/main.lua"))()
local thumper = script.Parent

local animator = KSP.newAnimator(thumper)

local track = animator:LoadAnimation(thumper.AnimSaves:WaitForChild("thump"))

track.Looped = true
track:Play()
track:AdjustSpeed(1.7)

thumper.CombineThumper002_reference.Ambient:Play()

track.KeyframeReached:Connect(function(keyframeName)
	local sound = thumper.CombineThumper002_reference:FindFirstChild(keyframeName)
	if sound then
		local c: Sound = sound:Clone()
		c.Parent = thumper.CombineThumper002_reference
		c:Play()
		c.Ended:Wait()
		c:Destroy()
	end
end)
]==],thumper)
INFO