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: Farming Script (Help!)

Previous Thread :: Next Thread 
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 09:43 AM
This is directly in a tool, and is supposed to, when clicking a part named Pea, destroy it and give the player things. Works in studio, but in game not even the mouse icon shows up. Please help.


bin = script.Parent
halt = false

function onButton1Down(mouse)
local hit = mouse.Target

if (hit == nil) or (halt == true) then return end
halt = true
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
bin.Ping:play()

if (hit.Name == "Pea") then
game.Players.LocalPlayer.leaderstats.Harvest.Value = game.Players.LocalPlayer.leaderstats.Harvest.Value + 15
game.Lighting.PeaSeed:clone().Parent = script.Parent.Parent
game.Lighting.PeaSeed:clone().Parent = script.Parent.Parent

while hit.Part.Transparency <= 1 do
hit.Part.Transparency = hit.Part.Transparency + 0.2
wait(0.01)
end

wait(0.01)
hit:remove()
end

wait(0.05)
halt = false
mouse.Icon = "rbxasset://textures\\GunCursor.png"
end


function onSelected(mouse)
print("Action Tool Selected")
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 09:44 AM
Sorry it's so long
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 09:51 AM
:C Probably something with the cursor
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:06 AM
:C
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:08 AM
pls
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:11 AM
someone
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:14 AM
anyone
Report Abuse
oscar9999991 is not online. oscar9999991
Joined: 15 Nov 2009
Total Posts: 11373
04 Oct 2014 10:17 AM
how about putting a wait(2) in front of the entire script
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:21 AM
Hm I tried, and it works in studio as well, but in game the mouse only changes from white to black and doesn't function.
Report Abuse
oscar9999991 is not online. oscar9999991
Joined: 15 Nov 2009
Total Posts: 11373
04 Oct 2014 10:22 AM
are there any errors?
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:24 AM
No that's the weird part, it works great in F6
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
04 Oct 2014 10:24 AM
if (hit == nil)

change it to if hit ~= nil
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:28 AM
:\ That doesn't work either
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
04 Oct 2014 10:30 AM
Why dont you add prints between each line and see where it stops
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:32 AM
good idea
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:42 AM
Ok I got rid of the "if (hit == nil) or (halt == true) then return end"
Works fine in studio but for some reason still doesn't in the game, is there a way to see script output in game?
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:43 AM
Besides F9


And any more suggestions?
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:47 AM
anything regarding the mouse icon?
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:50 AM
Maybe there's something different between the server and single player testing .-.
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 10:57 AM
.-.
Report Abuse
KingRobloxVII is not online. KingRobloxVII
Joined: 04 Jan 2012
Total Posts: 1756
04 Oct 2014 11:02 AM
b
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
04 Oct 2014 11:39 AM
There is a difference between solo and server
Solo everything is run on Client (local) while server things are run on both server and client.
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