|
| 14 Jan 2014 08:17 AM |
So I have recently created a function:
Player = game.Workspace.Market.PotionandFoodShop.Hit.Parent.Name
function Shop(onTouch) a = Instance.new("ScreenGUI", game.Players.Player.StarterGui) a.Name = ("PotionandFoodShop") b = Instance.new("TextBox", game.Playerps.StarterGui.PotionandFoodShop) b.Name = Background b.Text = ("") b.BackgroundColor3 = 0, 0, 0 b.BorderColor3 = 15, 102, 0 b.Size = {0, 700}, {0, 500} b.Position = {0.25}, {0.0625, 0} b.BorderSizePixel = 4 c = Instance.new("TextBox", game.Playerps.StarterGui.PotionandFoodShop) c.Name = Title c.BackGroundTransparency = 1 c.Position = {0.5, 0}, {0.100000001, 0} c.FontSize = ("Size48") c.TextColor3 = 255, 255, 255 d = Instance.new("TextBox", game.Playerps.StarterGui.PotionandFoodShop) d.Name = ("X") d.Size = {0, 15}, {0, 15} d.TextColor3 = 255, 0, 4 e = Instance.new("ImageButton", game.Playerps.StarterGui.PotionandFoodShop) e.Name = ("HealthPotionButton") e.Position = {0.300000012, 0}, {0.00999999978, 0} e.Image = ("rbxassetid://142151993") f = Instance.new("ImageButton", game.Playerps.StarterGui.PotionandFoodShop) f.Name = ("SpeedPotionButton") f.Position = {0.450000018, 0}, {0.00999999978, 0} end
How do I call this function? Also, is the "Player" variable at the top working with this?
Any help is MUCH appreciated, thank you. |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2014 08:19 AM |
| I'm sorry, I forgot too say what I want too happen for this too start, I have a brick in game.Workspace.Market.PotionandFoodShop --PotionandFoodShop is the brick, I want when that is touched, for that function too start, I don't know how too do this though. (I knew how too at one time, but I have forgot over time as I have not used it in a long time.) |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Jan 2014 09:18 PM |
function Shop(hit) local Player = Game.Players:GetPlayerFromCharacter(hit.Parent) if not Player then return end a = Instance.new("ScreenGUI", Player.PlayeGui) a.Name = ("PotionandFoodShop") b = Instance.new("TextBox",a) b.Name = Background b.Text = ("") b.BackgroundColor3 = Color3.new(0, 0, 0) b.BorderColor3 = Color3.new(15/255, 102/255, 0) b.Size = UDim2.new(0,700,0,500) b.Position = UDim2.new(0.25,0.0625,0) b.BorderSizePixel = 4 c = Instance.new("TextBox", a) c.Name = "Title" c.BackgroundTransparency = 1 c.Position = UDim2.new(0.5, 0, 0.100000001, 0) c.FontSize = "Size48" c.TextColor3 = Color3.new(1,1,1) d = Instance.new("TextBox", a) d.Name = ("X") d.Size = UDim2.new(0, 15, 0, 15) d.TextColor3 = Color3.new(1, 0, 4/255) e = Instance.new("ImageButton", a) e.Name = ("HealthPotionButton") e.Position = UDim2.new(0.300000012, 0, 0.00999999978, 0) e.Image = ("rbxassetid://142151993") f = Instance.new("ImageButton",a) f.Name = ("SpeedPotionButton") f.Position = UDim2.new(0.450000018, 0, 0.00999999978, 0) end game.Workspace.Market.PotionandFoodShop.Touched:connect(Shop)
|
|
|
| Report Abuse |
|
|
|
| 14 Jan 2014 09:24 PM |
| ^This is not working on test mode, is this because it will only work on an actual server? |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Jan 2014 09:29 PM |
| Nope, I just tried it on server mode, and it is still not working, can someone PLEASE help me with this? |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2014 09:30 PM |
| Let me run it through the output. |
|
|
| Report Abuse |
|
|
|
| 14 Jan 2014 09:32 PM |
| It's not showing any syntax errors, it's just not working. |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Jan 2014 08:07 PM |
| It's still now working, can someone PLEASE help? (Bump) |
|
|
| Report Abuse |
|
|