I'm trying to make a brick that pops a Gui onto your screen when you touch the brick. It's not doing anything though. I've fixed it to the point that no errors appear in the Output, but it still doesn't do anything.
function onTouched(hit)
if hit.Parent.Humanoid ~= nil then
player = hit.Parent.Parent.Name
for i,v in pairs(game.Players:GetChildren()) do
if v.Name == player then
plr = v
EnchantBG = plr.PlayerGui.ScreenGui.EnchantBG
if EnchantBG.Visible == false then
EnchantBG.Visible = true
EnchantBG.Position = UDim2.new(0,545,0,-550)
EnchantBG:TweenPosition(UDim2.new(0,545,0,60), "Out", "Bounce", 1)
else
EnchantBG.Visible = true
end
end
end
end
end
script.Parent.Touched:connect(onTouched)

1 comment
Awesome, thanks! Sadly, someone rated you down, but I rated you up so you stay even.