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 doesnt this script work in online?

Previous Thread :: Next Thread 
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
04 Oct 2012 11:22 PM
it works in play solo, it is a regular script in the workspace like this:

Weld--script
-Player--string value
-Tool--object value of tool

all variables are correct and I will put -- by commas to show what it says "prints"...

function print(first, ...)
local rest = {...}
console =game.Players[script.Player.Value].PlayerGui.Messages.Center.Print
console.Visible=true
console.Script.Value=script.Parent:GetFullName()
console.Print.Value=tostring(first)
for _, v in pairs(rest) do
console.Print.Value= console.Print.Value .. " '" .. tostring(v) .. "'"
end
end

print("started script")--prints

function Weld(x,y)
local W = Instance.new("Weld")
W.Part0 = x
W.Part1 = y
local CJ = CFrame.new(x.Position)
local C0 = x.CFrame:inverse()*CJ
local C1 = y.CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = x
print("Weld(x,y) works")--prints...
end
function Get(A)
if A.className == "Part" then
Weld(script.Tool.Value.Handle, A)
A.Anchored = false
else
local C = A:GetChildren()
for i=1, #C do
Get(C[i])
end
end
end
print("Get(A) works")--prints...
function Finale()
Get(script.Tool.Value)
end
script.Tool.Value.Equipped:connect(Finale)
script.Tool.Value.Unequipped:connect(Finale)
print("equipped/unequiped works")--prints this
Finale()
print("Final works")--prints this...

game.Players.PlayerRemoving:connect(function(player)
if player.Name==script.Player.Value then
script:Destroy()
end
end)
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
05 Oct 2012 01:05 AM
Most of the time it is because you have it in the wrong type of script, generally if it is in a script in this case it needs to be in a local script or vica versa.
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
05 Oct 2012 01:09 AM
if it was in a local script then it would not work because it is in the workspace...
Report Abuse
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
05 Oct 2012 09:34 AM
Make sure the player string value gets its value
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
05 Oct 2012 06:31 PM
tried as a local script in the players backpack it also does not work
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
05 Oct 2012 07:11 PM
BUMP
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
05 Oct 2012 08:47 PM
burnp
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
05 Oct 2012 09:48 PM
y u no help meh?

almost at 100 posts... plawx guise?
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
05 Oct 2012 11:35 PM
bump
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
05 Oct 2012 11:54 PM
Rename the print Function something else.
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
06 Oct 2012 12:28 AM
print function works fine...
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
06 Oct 2012 11:36 AM
bump
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
06 Oct 2012 12:36 PM
correction: print function does not change the text unless in play solo, not in multiplayer, I renamed it but it did not help...
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
06 Oct 2012 03:47 PM
bump
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
07 Oct 2012 01:54 PM
BUMP
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
07 Oct 2012 03:00 PM
bump
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
08 Oct 2012 07:36 PM
nobody knows?
Report Abuse
sirsavary is not online. sirsavary
Joined: 27 May 2008
Total Posts: 1222
08 Oct 2012 07:44 PM
Rename the print function. Print is something that is built into Rbx.Lua, there is likely a conflict.

Join the Tamerac RPG Beta Group for exclusive updates! Also, TRADE REQUESTS!
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
08 Oct 2012 08:47 PM
it does not conflict with other scripts and i tried renaming it already
Report Abuse
sirsavary is not online. sirsavary
Joined: 27 May 2008
Total Posts: 1222
08 Oct 2012 08:48 PM
Where is the script located and what is it's purpose?

Join the Tamerac RPG Beta Group for exclusive updates! Also, TRADE REQUESTS!
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
08 Oct 2012 10:42 PM
1st script a textbutton to clone 2nd script either to workspace or to a players backpack.
2nd script. Welds a tool when it is equiped, needs to be outside of the tool because the players character that is holding the tool is in the currentcamera
Report Abuse
sirsavary is not online. sirsavary
Joined: 27 May 2008
Total Posts: 1222
09 Oct 2012 07:49 AM
Yeah, sounds like you need to make it a localscript.
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