I made a script that is supposed to make the needle in the model show if the Players needle's liquid is Crimson. And print "You don't have any liquid in your needle" if your needle's liquid is Fossil. But the script isn't working there are no output errors but the script is a Normal script not Local or Module. The place I want it in is correct.
function OnClicked(player)
local Plr = game.Players.LocalPlayer
if Plr.Backpack.Collector.MovingParts.Change.Color == "Crimson" then
print(player.Name.." clicked on blood extract.")
local needle = script.Parent:WaitForChild("Needle")
needle.Change.Transparency = 0
needle.NeedleGlass.Transparency = 0.3
elseif Plr.Backpack.Collector.MovingParts.Change.Color == "Fossil" then
print("Player has no blood needle")
end
end
script.Parent.ClickDetector.MouseClick:connect(OnClicked)
I was wondering how to fix this.

4 comments
I'm not asking for a whole remake of the script.
If it's a normal script, I don't think you can use LocalPlayer. Where is the script located exactly???
Try using a local script instead
Ok.