I need to access the player that clicks a block block. I also need to access the player who's mouse hovers over a block. My code only works in studio.
workspace.ChangeOutfit.ClickDetector.MouseClick:connect(function(changeOutfit)
local pz=game.Players.LocalPlayer.Character:GetChildren()
for i=1,#pz do
if pz[i].className=="Shirt" then
pz[i]:Destroy()
end
end
local shirt = Instance.new("Shirt")
shirt.Parent = game.Players.LocalPlayer.Character
shirt.Name = "NewOutfit"
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=332017894"
end)
This works in studio but not on a game server.
script.Parent.Parent.ClickDetector.MouseHoverEnter:connect(function(ShowClothingGui)
Gui = script.Parent.Clothing:Clone()
Gui.Parent = game.Players.LocalPlayer.PlayerGui
end)
script.Parent.Parent.ClickDetector.MouseHoverLeave:connect(function(HideClothingGui)
Gui:Destroy()
end)
The same with this code.
Thanks for your help.
