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)
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)