I want to make it so when a player touches a part the tool in their hand becomes visible. In line 3 I want to change it so anyone can use this not just me, I want it to find the player in workspace but i'm now sure how.
game.Workspace.TheTopBun.Touched:Connect(function(hit) if hit.Parent:IsA("Tool") and hit.Parent.Name == "Coookedburger" then game.Workspace.AnimatedSL.Coookedburger.TopBun.Transparency = 0 end end)
"hit"
Is supposed to be a part value not a Tool
. You don't need to do that since the value will always be a basepart
. But you do want to check for hit.Parent like this:
local Players = game:GetService("Players") game.Workspace.TheTopBun.Touched:Connect(function(hit) local Player = Players:GetPlayerFromCharacter(hit.Parent) local Tool = Player.Character:FindFirstChild("Coookedburger") if Player and Tool then Tool.TopBun.Transparency = 0 end end)