Hello! I need help with my GUI. I am making a store that sells trails. It uses a currency called "Cash." Can someone help me and tell what I did wrong?
quick1 = game.Players.LocalPlayer.Stats.Cash quick2 = game.Players.LocalPlayer.HumanoidRootPart num1 = 1000 script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayer.Stats.Cash.Value >= 1000 then quick1.Value = quick1.Value - num1 Instance.new("Part", game.Players.LocalPlayer.HumanoidRootPart) Instance.new("ParticleEmitter", quick2.Part) quick2.Part.Transparency = 1 quick2.Part.ParticleEmitter.EmissionDirection = 'Back' quick2.Part.ParticleEmitter.Color = "Bright blue" end end)
Thank you in advance.
Your mistake resides on the second line of your script, where you define your "quick2" value.
quick2 = game.Players.LocalPlayer.HumanoidRootPart
This won't work since the HumanoidRootPart is not located in the LocalPlayer, but rather in the LocalPlayer's Character. So the correct way to define this variable would be:
quick2 = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
Notice the ".Character" and the ":WaitForChild("HuamanoidRootPart")".