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

Tool Not Naming?

You May Recognize this script, I have made it too work for me but my problem is when it is supposed to rename the tool, the tool name comes out blank. Someone Help?

function tch(h)
if (h.Parent.Name == "Vanilla Sherbert") then
h.Parent.Name = "Mint Sherbert"
h.Parent.Handle.Type.TextureId = "http://www.roblox.com/asset/?id=141864017"
script.Parent.Parent.Spill.Transparency = 0
script.Parent.Sound:Play()
wait(2)
script.Parent.Parent.Spill.Transparency = 1
h.Parent.Drink1.BrickColor = BrickColor.new(21)
h.Parent.Drink1.Transparency = 0.1
d = Instance.new("Sound")
d.Parent = game.Workspace
d.Name = Drip
d.SoundId = "http://www.roblox.com/asset/?id=10722059"
d.Looped = false
d.IsPlaying = true
d.Volume = 0.5
wait(3)
d:remove()
end
end

script.Parent.Touched:connect(tch)

1 answer

The reason to your problem is because you're not giving a string value to a String Property of a Sound Object. Which is located in line 13: d.Name = Drip. To fix this, you need set the value with two double quotation marks (" ").

Final Code:

function touch(h)
	if (h.Parent.Name == "Vanilla Sherbert") then
		h.Parent.Name = "Mint Sherbert"
		h.Parent.Handle.Type.TextureId = "http://www.roblox.com/asset/?id=141864017"
		script.Parent.Parent.Spill.Transparency = 0
		script.Parent.Sound:Play()
		wait(2)
		script.Parent.Parent.Spill.Transparency = 1
		h.Parent.Drink1.BrickColor = BrickColor.new(21)
		h.Parent.Drink1.Transparency = 0.1
		
		local d = Instance.new("Sound")
		d.Parent = game.Workspace
		d.Name = "Drip"
		d.SoundId = "http://www.roblox.com/asset/?id=10722059"
		d.Looped = false
		d.IsPlaying = true
		d.Volume = 0.5
		wait(3)
		d:remove()
	end
end

script.Parent.Touched:connect(touch)

2 comments

0

Thank you that helped, but now in the output it says "cant set value"

0

Anything else after that? Set value on?

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