So I made a script for a block that has a surface gui when placed, but when I place it the block doesn't have the gui on it. Here's the script:
wait(0.1) local BG = Instance.new("SurfaceGui") local P = script.Parent.Parent.Part BG.CanvasSize = UDim2.new(130,100) BG.Parent = P BG.Face = ("Front") BG.Adornee = P local TL = Instance.new("TextLabel") TL.Position = UDim2.new(0,63,0,50) TL.TextColor3 = Color3.new(0,0,0) TL.FontSize = Enum.FontSize.Size48 TL.Parent = BG TL.Text = script.Parent.Parent.Properties.Text.Var.Value script.Parent.Parent.Properties.Text.Var.Changed:connect(function() TL.Text = script.Parent.Parent.Properties.Text.Var.Value end)
Help?
Maybe add a touch event to the block's script to imitate a PlaceEvent?
local connection = script.Parent.Touched:connect(function() -- Paste your code here. connection:disconnect() end)
What I am doing here is that I am creating a touch event, storing the connection line as a variable, connection
and after the event is fired, it means that the block has been placed, so I the event doesn't get called again, I simply disconnect the event.