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: HopperBin script will not work in Play mode

Previous Thread :: Next Thread 
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 12:58 PM
I made a script for a hopperbin that destroys your package and gives you a new one from a folder in ServerStorage. It is all ran from a LocalScript and works well in Studio Mode, but will do nothing in Game/Play mode. How can I make it work in Play mode? Here is the script:

local plr = game.Players.LocalPlayer
local char = plr.Character
local mouse = plr:GetMouse()
local bin = script.Parent
bin.Selected:connect(function()
bin.EquippedValue.Value = true
for _,v in pairs(char:GetChildren()) do
if v:IsA("CharacterMesh") then
v:Destroy()
end
end
for _,k in pairs (game.ServerStorage.CharacterMeshFolder:GetChildren()) do
local vclone = k:Clone()
vclone.Parent = char
end
end)

Please help soon! Thanks!
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 01:13 PM
bump

~~I tried.
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 01:21 PM
bump[2]
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
01 Mar 2015 01:25 PM
Is it in a LocalScript?

It has to be in a LocalScript.
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 01:25 PM
Yes, it is in a LocalScript
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
01 Mar 2015 01:26 PM
sorry i didn't read
ignore me

You can't access ServerStorage with LocalScripts

Use ReplicatedStorage instead.
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 01:27 PM
That still does not work :/ I have no Idea why

Also, nice username. I am a Christian as well :P
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
01 Mar 2015 01:32 PM
You need to move the CharacterMeshFolder into ReplicatedStorage.
Then use this script:

local plr = game.Players.LocalPlayer
local char = plr.Character
local mouse = plr:GetMouse()
local bin = script.Parent
bin.Selected:connect(function()
bin.EquippedValue.Value = true
for _,v in pairs(char:GetChildren()) do
if v:IsA("CharacterMesh") then
v:Destroy()
end
end
for _,k in pairs (game.ReplicatedStorage.CharacterMeshFolder:GetChildren()) do
local vclone = k:Clone()
vclone.Parent = char
end
end)
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 01:35 PM
Hm, it still does not work! Strange, everything was done correctly.

This is why I hate Lua sometimes -__-
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 01:41 PM
Any other suggestions?
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 01:53 PM
bUmP
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 02:01 PM
Please help
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 02:07 PM
I edited the script to where when F is pressed, it gives the package. Here is the script:

mouse.KeyDown:connect(function(Key)
if bin.EquippedValue.Value == true then
if Key == "f" then
local pgui = plr.PlayerGui:FindFirstChild("MageActivationGui")
if pgui then
pgui:Destroy()
end
bin.CanAttack.Value = true
for _,v in pairs(char:GetChildren()) do
if v:IsA("CharacterMesh") then
v:Destroy()
end
end
for _,k in pairs (game.ReplicatedStorage.CharacterMeshFolder:GetChildren()) do
local vclone = k:Clone()
vclone.Parent = char
end
end
elseif bin.EquippedValue.Value == false then
if key == "f" then
print("No")
end
end
end)

Other Edits ~
Changed the CharacterMeshFolder from a Folder to a Model

The Script still doesn't work! How can I fix this?
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 02:32 PM
bump
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 02:45 PM
Bump[2]
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 03:30 PM
bump[3]
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 03:35 PM
bump[4]
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 03:53 PM
bump[5]
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 03:54 PM
print(bump[5])
> nil


Under these situations, it's very hard to help people. So, here's the way you help yourself.

The process of debugging involves understanding what the monstrosity you've made even does. It's hard to tell for humans what goes on in computers, and this is why debugging is even necessary.

The absolute best way to debug is to use a debugger, which is a tool in good IDEs. I'm not sure about Roblox's, and I think it's hard to use for somebody who is already having issues.

The second best is to print things. The output is always accessible, and it's great! Use it!

When something important happens, print its value in the output, and a helpful message like "10th line" or "second function"

By doing this, you identify what the code is doing. To fix your code, compare what actually happens to what you want to happen. Then you can inspect the specific area where something is wrong and hopefully fix it!
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 04:13 PM
I understand this, but the output is not accessible in-game. I still really do not understand this. Everything was done correctly, why doesn't it work in Play mode?
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 04:15 PM
I kinda contradicted what I just said, I meant I understand the debugging aspect, but I do not understand why the whole thing will not work when it is set up correctly
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 04:23 PM
any other ideas on how to make this work in-game? I cannot seem to figure it out at all :/
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
01 Mar 2015 04:36 PM
bump[6 or 5?]
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 04:41 PM
'I understand this, but the output is not accessible in-game. I still really do not understand this. Everything was done correctly, why doesn't it work in Play mode?'

If you are the place owner, hit F9 in-game to open the output.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 04:42 PM
'I do not understand why the whole thing will not work when it is set up correctly'

I think it's obvious at this point that it isn't set up correctly, and that's why things don't work.
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