generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help with an Even Driven Function,

Previous Thread :: Next Thread 
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
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
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
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
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
14 Jan 2014 09:10 PM
Bump.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
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
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
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
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
14 Jan 2014 09:28 PM
Errors?
Report Abuse
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
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
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
14 Jan 2014 09:30 PM
Let me run it through the output.
Report Abuse
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
14 Jan 2014 09:32 PM
It's not showing any syntax errors, it's just not working.
Report Abuse
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
14 Jan 2014 10:20 PM
Bump
Report Abuse
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
15 Jan 2014 08:07 PM
It's still now working, can someone PLEASE help? (Bump)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image