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: Why doesn't this work

Previous Thread :: Next Thread 
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Oct 2013 03:05 PM
There are no syntax errors that I see but I think there might be on the line that I have commented on. Not sure if that is it or if there are more errors that I don't see. I have tested in online mode, and it doesn't seem to work. The user variable is indeed correct ( this script is in a GUI). This script is also in a localscript:

user = script.Parent.Parent.Parent
mouse = user:GetMouse()
local build = Instance.new("BoolValue", user)
build.Value = false
build.Name = 'build'
local destruct = Instance.new("BoolValue", user)
destruct.Value = false
destruct.Name = 'destruct'

mouse.KeyDown:connect(function(key)
if key == 'b' then
if build.Value == false then
if destruct.Value == true then
destruct.Value = false
build.Value = true
end
elseif build.Value == true then
build.Value = false
end
elseif key == 'd' then
if destruct.Value == false then
if build.Value == true then
build.Value = false
destruct.Value = true
elseif build.Value == false then
build.Value = false
destruct.Value = true
end
elseif destruct.Value == true then
destruct.Value = false
end
end
end)

mouse.Button1Down:connect(function()
if build.Value == true then
local pos = mouse.Hit.p -- here?
local val = user.bbucks.Value
error = scirpt.Parent.errornotification
if val > 0 then
local part = Instance.new('Part', Workspace.CurrentCamera)
part.FormFactor = 'Symmetric'
part.Size = Vector3.new(2,2,2)
part.BackSurface = 'SmoothNoOutlines'
part.BottomSurface = 'SmoothNoOutlines'
part.FrontSurface = 'SmoothNoOutlines'
part.LeftSurface = 'SmoothNoOutlines'
part.RightSurface = 'SmoothNoOutlines'
part.TopSurface = 'SmoothNoOutlines'
val = val-1
elseif val == 0 then
error.TextLabel.Text = "You don't have enough Builder Bucks for that!"
error:TweenPosition(UDim2.new(.35,0,.5,0))
wait(5)
error:TweenPosition(UDim2.new(.35,0,-1,0))
wait()
error.TextLabel.Text = ""
end
elseif destruct.Value == true then
mouse.TargetFilter = Workspace.undeletableparts
local targ = mouse.Target
targ:Destroy()
local val = user.bbucks.Value
val = val + 1
end
end)

Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Oct 2013 03:14 PM
another note: All the players characters are local (local parts). That might be the problem... but how do I fix it!
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
12 Oct 2013 03:15 PM
Well for user I dont see why u dont put game.Players.LocalPlayer
The mouse.Hit.p is correct but note it returns a vector3
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Oct 2013 03:21 PM
Ok, so I fixed that to be:

part.Position = Vector3.new(pos)



But it still didn't work. I think I know what's wrong with it, but I just need to know one thing to fix it.... Is it possible to put a part in a specific player's camera? I think I did it wrong
Report Abuse
jnickib is not online. jnickib
Joined: 28 May 2012
Total Posts: 137
12 Oct 2013 03:45 PM
u r nuts

~It's me, 08C, on an alt for a day!
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Oct 2013 03:48 PM
Sure I am, what's your point?
Report Abuse
jnickib is not online. jnickib
Joined: 28 May 2012
Total Posts: 137
12 Oct 2013 03:48 PM
Wanna be friends?
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Oct 2013 03:51 PM
Did I do anything wrong in that script?
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
12 Oct 2013 04:12 PM
Nobody?
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 09:43 AM
Seriously I need to fix this.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 09:53 AM
bump
Report Abuse
XxminijokerXx is not online. XxminijokerXx
Joined: 13 Nov 2011
Total Posts: 10321
13 Oct 2013 09:57 AM
[ Content Deleted ]
Report Abuse
XxminijokerXx is not online. XxminijokerXx
Joined: 13 Nov 2011
Total Posts: 10321
13 Oct 2013 09:57 AM
[ Content Deleted ]
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 09:59 AM
It's supposed to make bool values in the player that signify what to do when the player clicks. If the player presses b on the keyboard, the value "build" will become true so that when the mouse clicks, it will build and not destroy things, the same thing with the d key. d will activate the remove tool.
Report Abuse
XxminijokerXx is not online. XxminijokerXx
Joined: 13 Nov 2011
Total Posts: 10321
13 Oct 2013 10:02 AM
[ Content Deleted ]
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 10:04 AM
What do you mean?
Report Abuse
XxminijokerXx is not online. XxminijokerXx
Joined: 13 Nov 2011
Total Posts: 10321
13 Oct 2013 10:17 AM
[ Content Deleted ]
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 12:11 PM
Well, I think I know how to fix my script, I just need to know how to put parts to be seen by only one specific player. I know that that would require local parts, but I just don't think I did it right.
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 12:38 PM
Seriously, does it have to be this hard to get a reply?
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 12:59 PM
bump...
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 01:23 PM
Bump!
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 02:07 PM
bump
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 03:13 PM
bump
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 04:50 PM
bump
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
13 Oct 2013 05:20 PM
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