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

Joke sans tool not having Its debounce end, as well of not moving to where the player Is facing (?)

Hello! Im making a joke version of a sans move from undertale, which he summons bones that damages the player, the way Im doing It Is that when the player clicks with the tool equip, It summons a bone facing where the player (Septically where the torso of the player) that moves, dealing 10 damage. It works (Kinda) but as the title says, the bone always moves In the same direction, and not where the player Is facing, though It does point towards, also the debounce for some reason won't end

Note: The tool has no handle No errors appear In output

Script:

local tool = script.Parent
local FunnySounds = tool["Random Phases for chatting lol"]
local ToolEquip = false
local Debounce = false
--[[ Im adding these soon
local EpicChat = {
	"[Insert pretty cringey sans text here lol]",
	"TIMMY GET OUT THE COMPUTER",
	"Hello? Is this amongus... Imposter, Is dis the Imposter from amongus"
}
]]

tool.Equipped:Connect(function()
	ToolEquip = true
	while ToolEquip do
		wait(3)
		local RandomChitChat = math.random(1,3)
		
		if RandomChitChat == 1 then
			FunnySounds["TIMMY GET OUT OF THE COMPUTER"]:Play()
		end
		if RandomChitChat == 2 then
			FunnySounds["Maybe thats the way your dress"]:Play()
		end
		if RandomChitChat == 3 then
			FunnySounds["Is dis amongus?"]:Play()
		end
	end
end)

tool.Unequipped:Connect(function()
	ToolEquip = false
end)

tool.Activated:Connect(function()	
	if Debounce == false then
		Debounce = true
		local Bone = Instance.new("Part")
		local BoneDecal1 = Instance.new("Decal")
		local BoneDecal2 = Instance.new("Decal")
		Bone.Parent = game.Workspace
		BoneDecal1.Parent = Bone
		BoneDecal2.Parent = Bone
		BoneDecal1.Texture = "http://www.roblox.com/asset/?id=6463782127"
		BoneDecal2.Face = Enum.NormalId.Back
		BoneDecal2.Texture = "http://www.roblox.com/asset/?id=6463782127"
		Bone.Size = Vector3.new(4, 5.843, 0.001)
		Bone.Position = tool.Parent.Torso.Position
		Bone.Orientation = tool.Parent.Torso.Orientation
		Bone.Transparency = 1
		Bone.Anchored = true
		Bone.CanCollide = false
		game:GetService("Debris"):AddItem(Bone,3)
		while Bone and wait(0.1) do
			Bone.CFrame = Bone.CFrame+Vector3.new(0,0,-10)
		end
		wait(3)
		Debounce = false
	end
end)

3 comments

0

I'm not gonna post this as an answer as im not sure it will work, but make use of LookVector. It can be called using Part.CFrame.LookVector and is basically the stud right in front of where the parts front is, making futher use of multiplication turns it into Bone.CFrame = Bone.CFrame + (Bone.CFrame.LookVector * StudsPerFrame)

1

As for the debounce not ending it make be a case of an error happening, insteal of using a while loop, use a for i = 1,30 do task.wait(0.1) Bone.CFrame = Bone.CFrame + (Bone.CFrame.LookVector * StudsPerFrame) end

0

Works, just can you post this all as a answer?

1 answer

hey you! have you ever heard of enes? if you are in trouble, better call enes!

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