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: simple script not working

Previous Thread :: Next Thread 
PositiveDeveloper is not online. PositiveDeveloper
Joined: 21 May 2011
Total Posts: 3608
10 Aug 2015 10:52 PM
--THE OUTPUT

20:45:59.378 - Players.Player.PlayerGui.Admin_Panel.Server_Shout.Shout_Server.Script:6: bad argument #3 to 'Parent' (Object expected, got string)

--THE CODE

local PlayersService = game.Players
local MyMouse = PlayersService.localPlayer:GetMouse()

MyMouse.KeyDown:connect(function(key)
if string.lower(key) == 'e'then
game.ServerStorage.Shout.Parent = "StarterGui"
wait(5)
game.ServerStorage.Shout.Parent = "ServerStorage"
end
end)
print("test")



PositiveDeveloper, Scripting Guru and 3 Year Building Veteran, kiss kiss
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
10 Aug 2015 10:56 PM
local uis = game:GetService("UserInputService")

uis.InputBegan:connect(function(input, event)
if event then return end
if input.KeyCode == Enum.KeyCode.E then
print("Pressing E")
end
end)


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
PositiveDeveloper is not online. PositiveDeveloper
Joined: 21 May 2011
Total Posts: 3608
10 Aug 2015 10:58 PM
no its moving the thing from ServerStorage to StarterGui thats failing




PositiveDeveloper, Scripting Guru and 3 Year Building Veteran, kiss kiss
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
10 Aug 2015 11:01 PM
first of all, I gave you a method that is much better. Secondly, you can access objects in ServerStorage from a local script, thirdly, to change the parent of an object you have to define the actual container

thing.Parent = workspace.Model

thing.Parent = game.ReplicatedStorage


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
10 Aug 2015 11:01 PM
can't access*


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
PositiveDeveloper is not online. PositiveDeveloper
Joined: 21 May 2011
Total Posts: 3608
10 Aug 2015 11:10 PM
its not a localscript but ok
what i have now works, but the whole point doesnt
i wanted it to move it to starterGui, and become visible.
but it doesnt become visible?
im dumb


local PlayersService = game.Players
local MyMouse = PlayersService.localPlayer:GetMouse()

MyMouse.KeyDown:connect(function(key)
if string.lower(key) == 'e'then
game.ServerStorage.Shout.Parent = game.StarterGui
wait(5)
game.ServerStorage.Shout.Parent = game.ServerStorage
end
end)



PositiveDeveloper, Scripting Guru and 3 Year Building Veteran, kiss kiss
Report Abuse
PositiveDeveloper is not online. PositiveDeveloper
Joined: 21 May 2011
Total Posts: 3608
10 Aug 2015 11:24 PM
b1



PositiveDeveloper, Scripting Guru and 3 Year Building Veteran, kiss kiss
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
11 Aug 2015 12:54 AM
Why don't you just put it in the starter gui??????????
Report Abuse
PerilousDanger is not online. PerilousDanger
Joined: 21 Aug 2012
Total Posts: 3773
11 Aug 2015 12:58 AM
alright


what might be happening is




you're putting it in the StarterGui, but you only recieve the starterGUI when you respawn.


local players = game.Players:GetChildren()


for i = 1,#players do
d1 = game.ServerStorage.Shout:Clone()
d1.Parent = players[i]
end

wait(5)

for i = 1,#players do
d1 = players[i].StarterGui.Shout
d1:Destroy()
end
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