script.Parent.Touched:connect(function() local enabled = true local screengui = Instance.new("ScreenGui") screengui.Parent = game.StarterGui --For earned------- wait(4) local Earned = Instance.new("ImageLabel") Earned.Parent = screengui Earned.Position = UDim2.new(0.4,0,0.2,0) Earned.Size = UDim2.new(0,250,0,250) Earned.Image = "http://www.roblox.com/asset/?id=377070223" Earned.Visible = true end)
i tried it in a local script put the script wont activate or in a regualer script it won't show up on your screen.
and no errors came up in the output
StarterGui is just a container. It's contents are copied over to the player's PlayerGui. So, parenting things to the StarterGui won't work.
script.Parent.Touched:connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) ~= nil then -- Check if what touched it is even a player. local player = game.Players:GetPlayerFromCharacter(hit.Parent) local enabled = true local screengui = Instance.new("ScreenGui") screengui.Parent = player.PlayerGui -- You parent it to the PlayerGui, not StarterGui. --For earned------- wait(4) local Earned = Instance.new("ImageLabel") Earned.Parent = screengui Earned.Position = UDim2.new(0.4,0,0.2,0) Earned.Size = UDim2.new(0,250,0,250) Earned.Image = "http://www.roblox.com/asset/?id=377070223" Earned.Visible = true end end)
Hope this helped.