So apparently, half of my scripts are not working correctly and I do not know why.

-- Scroll passed this section to only edit text.

function onTouch(hit)

	if hit.Parent:FindFirstChild("Humanoid") ~= nil then

		if game.Players:FindFirstChild(hit.Parent.Name) ~= nil then
		local player = game.Players:FindFirstChild(hit.Parent.Name)

			if player:FindFirstChild("PlayerGui"):FindFirstChild("ScreenGui") == nil then
			sg = Instance.new("ScreenGui")
			sg.Parent = player:FindFirstChild("PlayerGui")
			end

		if player.PlayerGui.ScreenGui:FindFirstChild("MessageBox") == nil then

		local f = Instance.new("ImageLabel") --does not appear anymore in online play...
		f.Name = "MessageBox"
		f.Position = UDim2.new(0.15, 0, 0.65, 0)
		f.Size = UDim2.new(0,0, 0,0)		
		f.Image = "rbxassetid://752446664"							
		f.Parent = player.PlayerGui:FindFirstChild("ScreenGui")
        f.BackgroundTransparency = 1

        local g = Instance.new("ImageLabel")
		g.Name = "MessageBox"
		g.Position = UDim2.new(0.17, 0, 0.68, 0)
		g.Size = UDim2.new(0.085, 0, 0.17,  0)		
		g.Image = "rbxassetid://629080158"							
		g.Parent = player.PlayerGui:FindFirstChild("ScreenGui")
        g.BackgroundTransparency = 1

        local d = Instance.new("ImageLabel")
		d.Name = "MessageBox"
		d.Position = UDim2.new(0.17, 0, 0.68, 0)
		d.Size = UDim2.new(0.085, 0, 0.17,  0)		
		d.Image = "rbxassetid://629096041"							
		d.Parent = player.PlayerGui:FindFirstChild("ScreenGui")
        d.BackgroundTransparency = 1
        
        


		


wait()
f:TweenSize(UDim2.new(0.7,0, 0,170), 'Out' ,'Quad' , 0.5)


while true do
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	wait(0.05)
	d.ImageTransparency=  1
	wait(0.05)
	d.ImageTransparency = 0
	break
end

wait(5)
f:TweenSize(UDim2.new(0, 0,0, 0), 'Out' ,'Quad' , 0.5)

wait(1)
        d:Destroy()
		g:Destroy()
		f:Destroy()
		
		end
		end
	end
end

script.Parent.Touched:connect(onTouch)



2 comments

0

f.Size = UDim2.new(0,0, 0,0) f size is 0 so it wont be visable

0

ik but it tweens to a different size, i mean actual image is not appearing. @khanISawesomethe1st