|
| 20 May 2017 12:05 AM |
| so i want to make a brick and what it does is, whenever you step on it a gui turns visible, and then in a few s e c o n d s it turns invisible, does anybody know how to code that?? i tried it but it doesn't work, i tried everything and it didn't work... im pretty new to coding btw... |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 May 2017 12:21 AM |
how do u step on a gui
also u havent tried everything because there r probably multiple solutions |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:24 AM |
script.Parent.Touched:connect(function(part) if part.Parent:findFirstChild("Humanoid") then local Char = part.Parent local Player = game.Players:GetPlayerFromCharacter(Char) print(Char) Player.PlayerGui.GUI.Frame.Visible = true end end) |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:26 AM |
| its a brick to be stepped on not gui |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:27 AM |
| somehow i skimmed over the 'it' my b |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:27 AM |
| Ok P r a e t o r i a n ill try that... |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:29 AM |
| If you mean a SurfaceGui, just make OnTouched Event and make it Enable/Disable the SurfaceGui using the Script part its parented with. |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:30 AM |
| what are the chars supposed to be P r a e t o r i a n?? im really sorry for the questions, im new to coding :/ |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:32 AM |
Well I haven't tested it but try this. Hope this helps. just follow my instructions
--PUT THIS IN A LOCALSCRIPT Inside the brick inside the player
brick = game.Workspace. --Complete the path to the brick Gui = game.Players.LocalPlayer.PlayerGui ---Complete the path to GUI. time = 10
debounce = true
script.Parent.Touched:connect(function(hit) if debounce == true then
debounce = false
if hit.Parent.Name == game.Players.LocalPlayer.Name then
Gui.Visible = true
end
end
wait(time)
debounce = true
end)
|
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:34 AM |
'PUT THIS IN A LOCALSCRIPT Inside the brick inside the player' ??? also that code lmao |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 May 2017 12:35 AM |
| no i mean like a g u i on the screen graphics... |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:36 AM |
| lemme try this too ninja r a f.. |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:36 AM |
| what the hell are you talking about that script will make a Gui visible if you step on a brick |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:36 AM |
just put this local script in the gui item u want to hide and show
local part = workspace....... --put part here
local player = game.Players.LocalPlayer
local active = false
part.Touched:connect( function(hit) if not hit.Parent or not player.Character or active then return end if hit:IsDescendantOf( player.Character ) then active = true script.Parent.Visible = true wait( period ) script.Parent.Visible = false active = false end end) |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:39 AM |
| Just tested it. it worked for me bud. |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:42 AM |
| but urs doesnt account for if they touch it with anything nor does it make sense to have it in a random part in the character |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:46 AM |
| W u n d e r yours isn't working ill try ninja's.. |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:47 AM |
| why do you type like t h i s |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:47 AM |
| i do that to remove roblox tags :p |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:50 AM |
| mine works just fine just route it to the part and then change period to whatever time u want |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:52 AM |
| i did that but it didn't work :/ |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 12:56 AM |
| for everyone who doesn't know what the heck im trying to tell, im basically saying that, i want to make a " s u b # # # l e " kinda thing, so whenever you go infront of a specific door, the transparent button under it will trigger the code to make the g u i aka the text visible then waiting for a few s e c o n d s and then it goes invisible. |
|
|
| Report Abuse |
|
|
|
| 20 May 2017 01:05 AM |
Oh im sorry man I didn't understand what you were asking. Put this in a brick. I made this few weeks ago. Just edit the properties or remove some that you don't need This works perfectly.
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("Frame") f.Name = "MessageBox" f.Position = UDim2.new(0.3, 0, 0.1, 0) f.Size = UDim2.new(0.4, 0, 0, 50) f.Style = "RobloxRound" f.Parent = player.PlayerGui:FindFirstChild("ScreenGui")
local m = Instance.new("TextLabel") m.Position = UDim2.new##############0## ####FontSize = "Size14" m.TextColor3 = Color3.new(1,1,1) m.Parent = f
m.Text = "Insert text here" wait(3)
m.Text = "Insert more text here" wait(3.5)
m.Text = "Or even have colored text" m.TextColor3 = Color3.new(1,0,0) wait(2)
f:Destroy() end end end end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|