local brick = script.Parent
function onTouch(part)
--This will give the player a "Challenge Over" gui, which should dissapear on promt.
instance.copy("Gameover")
end
someone helped with this script on rblx forums but didn't pay attention to the topic
how do i change the gui's parent
Instance.copy isn't even a thing (Unless it was added in 2016, where I didn't really check out anything new on Roblox coding)
You tried to Torquescript on Lua.
Since a lot of scripting help as been approaching this topic, I might as well help with this one too.
--So let's get underway!
--Unneeded variable removed.
script.Parent.Touched:connect(function(part) --This is how you do stuff upon an event.
--Now a function executes with variable "part" being the part that came into contact with the brick.
--So let's do the following checks:
--Is the part touched a literal part of a Robloxian, and are they controlled by a player?
--You may remove the player check if you aren't going to use NPCs
if part.Parent:FindFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(part.Parent) then
local gameover = game.ServerStorage.GameOverGu i:Clone() --This creates a copy of the GUI ready for us to transfer to the player (and enable scripts if necessary)
gameover.Parent = game.Players:GetPlayerFromCharacter(part.Parent).PlayerGui --As far as I know, you cannot create variables within methods like in Torquescript
--gameover.Frame.Script.Disabled = false (Use this if you have some script along with the GUI
end) --End a function called by an event like this, since it closes the parenthesesP.S. TableSalt, I made a mistake over at the script I gave you, I'm going to fix it right now.