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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why won't this script work?

Previous Thread :: Next Thread 
coolanthony1239 is not online. coolanthony1239
Joined: 05 Jul 2011
Total Posts: 120
22 Nov 2015 12:11 AM
My first version did not work so I made another one and still the same problem. I'm thinking roblox studio is getting dumb.
Script: -- Made by Me
local StartingSpeed = 16

function Clicked()
local Player = game.Players.LocalPlayer.Name
local DeployButton = script.Parent.DeployButton
-- Giving Movement to Player After Clicked
local Character = game.Workspace:WaitForChild(Player)
Character.Humanoid.WalkSpeed = StartingSpeed
print("Given Movement To:" .. Player)
-- Disables Camera Manipulation
Character.Camera.Disabled = true -- Removes SurfaceMenu Gui
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
-- Checks For Glitchs within Player/Game
if script.Parent.DeployButton == nil then
print("R0B10X your dumb .-.")
end
if game.Workspace.Players:FindFirstChild("SlotSaves") == nil then
local Slot1 = Instance.new('StringValue', game.Workspace.Players)
Slot1.Name = "Slot1Owner"
-- Adding More Slots Later(FutureUpdate!)
end
end

script.Parent.DeployButton.MouseButton1Click:connect(Clicked)

I get the same error that 'DeployButton' is not a valid member of screen gui. I checked the name of DeployButton in the Gui but it's not working.
Report Abuse
coolanthony1239 is not online. coolanthony1239
Joined: 05 Jul 2011
Total Posts: 120
22 Nov 2015 12:13 AM
It works in roblox studio perfectly but not in online mode
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
22 Nov 2015 12:14 AM
give us the exact error so we can know what line this error occurs at.
Report Abuse
coolanthony1239 is not online. coolanthony1239
Joined: 05 Jul 2011
Total Posts: 120
22 Nov 2015 12:17 AM
22:15:51 -- DeployButton is not a valid member of ScreenGui
The Text Button is actually inside the Screen Gui
Report Abuse
coolanthony1239 is not online. coolanthony1239
Joined: 05 Jul 2011
Total Posts: 120
22 Nov 2015 12:18 AM
http://www.roblox.com/games/141375292/ALPHA-Edge
The game. The Error is in the local logs
Report Abuse
thecoolRPG is not online. thecoolRPG
Joined: 06 Jun 2014
Total Posts: 474
22 Nov 2015 12:18 AM
Press f9 in-game it usually shows the error
Report Abuse
coolanthony1239 is not online. coolanthony1239
Joined: 05 Jul 2011
Total Posts: 120
22 Nov 2015 12:19 AM
I got the error earlier.-.
Report Abuse
coolanthony1239 is not online. coolanthony1239
Joined: 05 Jul 2011
Total Posts: 120
22 Nov 2015 12:20 AM
I know the f9 logs. I said earlier the error. I have no clue how this was an error even though i had the textbutton in the screen gui
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
22 Nov 2015 12:23 AM
Because sometimes your scripts run faster than the gui objects load. Use :WaitForChild('GUIOBJECTNAME') to actually wait until the object gets loaded..
Report Abuse
coolanthony1239 is not online. coolanthony1239
Joined: 05 Jul 2011
Total Posts: 120
22 Nov 2015 12:51 AM
Still not working.
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
22 Nov 2015 08:05 AM
Is this a localscript?
Report Abuse
coolanthony1239 is not online. coolanthony1239
Joined: 05 Jul 2011
Total Posts: 120
22 Nov 2015 10:17 AM
Yes
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
22 Nov 2015 01:00 PM
I had the same problem with my Gui, solution: if u wanna describe a Textbutton in a local script dont use something like this: "local TB = script.Parent.TextButton" just use "TB = script.Parent.TextButton"

Like, in local script just use local to have values like "local money = 50"

Hope this helped if not publish this as a model and I will help :D
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