Script doesnt work


robloxapp-20230516-1426491.wmv (786.6 KB)

  1. What do you want to achieve? Keep it simple and clear!
    I want to make a morph tool that activates on click
  2. What is the issue? Include screenshots / videos if possible!
    the script does not work and im not good at scripting
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    nobody else tried to make a morphing tool and in the roblox toolbox they all dont work
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!


function ChangeMe()
	local player = script.Parent.Parent
	local character = player.Character
	local human = player.Humanoid
	if (human ~= nil) and debounce == false then
		debounce = true
		originals = char:getChildren()
		for w = 1, #originals do
			if originals[w].className == "CharacterMesh" then
				originals[w]:remove()
			end
		end
		meshes = script:getChildren()
		for y = 1, #meshes do
			copy = meshes[y]:clone()
			copy.Parent = char
		end
	end
	wait(5)
	debounce = false
end

script.Parent.Activated:connect(ChangeMe)



tool layout

Please check for errors in the output and let me know if you see any.

Replace char with character, as you defined character and not char.
same goes here:

yea i forgot about that

I edited my message with the fix, please check above.

Well, I wouldn’t suggest you to define player here, because you can only use the function when you equip, so replace this:

with:
local character = script.Parent.Parent and remove the
local player = script.Parent.Parent line

And also, it should be local human = character.Humanoid and not
local human = player.Humanoid

1 Like

it works now
asdawdadsadadadsdadadasdadads

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.