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 » Scripters
Home Search
 

Re: Script not working

Previous Thread :: Next Thread 
rockerslamtwo is not online. rockerslamtwo
Joined: 27 Mar 2011
Total Posts: 34
04 Mar 2015 08:54 PM
So, I continued with the script i was working on, I dont know what the problem is this time but it is simply not working, No errors show in the output so i dont know, Do you?

local CD = script.Parent

upgradecost = 5
dist = 3

enabled = true

local function onMouseClick(Player)
local p = game.Players:getChildren()
for i = 1, #p do
local gold =p[i].leaderstats:findFirstChild("Gold")
if (p[i].Name ~= script.Owner.Value) then
if gold.Value > upgradecost or gold.Value == upgradecost then
if (p[i].Character.Torso.Position - script.Parent.Parent.Position).magnitude < dist then
if not enabled then return end
enabled = false
gold.Value = gold.Value - upgradecost
local m = math.random(1,(2))
if m == 1 then
game.ServerStorage:FindFirstChild("Cheese"):clone().Parent = p[i].Backpack
print 'You Got Some Cheese!'
end
if m == 2 then
game.ServerStorage:FindFirstChild("Steel_Sword"):clone().Parent = p[i].Backpack
print 'You Got A Steel Sword!'
end

local Xplode = Instance.new("Explosion")
Xplode.Parent = Workspace
Xplode.Position = script.Parent.Parent.Position
Xplode.BlastPressure = 0
Xplode.BlastRadius = 1
Xplode.ExplosionType = "NoCraters"
game.Workspace.Chest_Lvl1:remove()

enabled = true
end
end
end
end
end
CD.MouseClick:connect(onMouseClick)
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
04 Mar 2015 08:59 PM
Unless roblox fixed the issue while I was gone, clickdetectors don't work anymore because of that filteringenabled thing
Report Abuse
rockerslamtwo is not online. rockerslamtwo
Joined: 27 Mar 2011
Total Posts: 34
04 Mar 2015 09:01 PM
The detectors were working before.
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
04 Mar 2015 09:04 PM
You can't connect to client's stuff (i.e. GUIs) through them. So guis, leaderstats, backpack, and tools can't be accessed via clickdetectors.

That's what I meant to say, sorry for the confusion
Report Abuse
rockerslamtwo is not online. rockerslamtwo
Joined: 27 Mar 2011
Total Posts: 34
04 Mar 2015 09:05 PM
Eeegh, What do you thing i could do, It kinda revolves around clicking xd
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
04 Mar 2015 09:06 PM
SurfaceGuis
Report Abuse
rockerslamtwo is not online. rockerslamtwo
Joined: 27 Mar 2011
Total Posts: 34
04 Mar 2015 09:07 PM
I also have no idea on how to use SurfaceGui's with this..
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
04 Mar 2015 09:09 PM
It's the same concept with additional stuff:

1) It's like regular GUIs, only it's on a surface of a brick
2) It's local like other GUIs, but the adornee must be set to the brick
3) You use a different event since it's a gui (MouseButton1Click)
Report Abuse
superconscript is not online. superconscript
Joined: 15 Mar 2012
Total Posts: 413
04 Mar 2015 09:14 PM
Also you have to use commandbar to set adornee or in your script cant be set in explorer though
Report Abuse
rockerslamtwo is not online. rockerslamtwo
Joined: 27 Mar 2011
Total Posts: 34
04 Mar 2015 09:30 PM
I'm hopeless at this, Someone mind helping me x.x
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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