Ok, so I want to create a brick that when you hover the mouse/cursor over it, and it will open up a shop GUI (and I would like for the GUI to tween onto your screen) that you can buy a shirt (or pants, or a t-shirt, or whatever) from. I think can make the GUI myself, but I cannot make the script or the actually GUI tween. What I don't want it to be is onTouch or ClickDetector GUI open, I want it so if you have your mouse cursor over the specified brick, it'll open the GUI, and once you move the mouse off the brick, the GUI goes away. If you can help me out with this, I'll give you my robux or something (I have over 900). I have tried looking through everything and trying everything I think could work for 2 hours.

I know this isn't a request forum, but I don't know where else to go (the ROBLOX forum moderators don't like my username).

Here is what I used before, but I changed my mind:

local near=true
--true makes it appear when a user is close
--false makes it appear when the brick is hit

local debounce=true
if near==true then
	while wait(0.1) do 
		for i,v in pairs(game.Players:GetChildren()) do 
			if v.Character.Torso~=nil then 
				if(v.Character.Torso.Position-script.Parent.Position).magnitude<(script.Parent.Size.X/1)+10 then 
					if v.PlayerGui:findFirstChild("ExampleGui")~=nil then return end
					script.ExampleGui:clone().Parent=v.PlayerGui
				end 
			end 
		end 
	end 
elseif near==false then
	if debounce==true then
		debounce=false
		script.Parent.Touched:connect(function(hit)
			local human=hit.Parent:findFirstChild("Humanoid")
			if (human==nil) then return end
			local player=game.Players:findFirstChild(hit.Parent.Name)
			if (player==nil) then return end
			if player.PlayerGui:findFirstChild("ExampleGui")~=nil then return end
			script.ExampleGui:clone().Parent=player.PlayerGui
		end)
	debounce=true
	end
end 

1 comment

0

Don't overtag...