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: Seriously solo mode just stop (Halp me SH)

Previous Thread :: Next Thread 
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 11:30 AM
/5wDFYG4P

>Works in solo mode
>Not in normal servers/playmode.

Damnit...Why -_-

This script contains two modes of animations firing, when we equip it, it should make a nice sword-take out equip animation, and nice hitting animations when we click with the button, works good in solo, not play.

Why?
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
31 Oct 2014 11:46 AM
I explained this before in another thread.

If something works in solo mode but not in online mode/server test mode, that means there's a server script trying to access something local to the player's client (which is only possible in solo mode, since there is no server and everything is running from the player's client), so you have to make it a local script inside the player's PlayerGui.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 11:47 AM
Sorry, didn't read everyones post from the other one, it was more like a message than a question :P

ill try though
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 11:48 AM
wait what am I saying

the local script is inside a tool in starterpack..cant move the script out
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
31 Oct 2014 11:52 AM
If it's a local script already, that may mean the local script is trying to access something only a server script can.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 12:03 PM
no..
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
31 Oct 2014 12:25 PM
Ugh, what's the script then?
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 12:27 PM
It's...it's in this thread, the meaning of this post...

Lol you thought I just posted another thread about the same thing, im not that kind of idiot :p
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
31 Oct 2014 12:30 PM
I mean the actual code

not an explanation of the script
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 12:36 PM
Damnit sly,

/5wDFYG4P

like its posted

...


Also, the issue basically is that solo mode loads animations fine, but nothing happens/animations dont fire in play mode
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 12:37 PM
This is about a script, when people gives things like

/5wDFYG4P

it means it is a pastebin

a popular site
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
31 Oct 2014 12:41 PM
Ohhh, I know what pastebin is but I thought you mean /5wDFYG4P on an image posting website (the name is cencored) im- g (u)r
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
31 Oct 2014 12:44 PM
Or, you know. Justpaste.it
Or prntscr lightshot thingy

Things like that...
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 12:58 PM
Sorry, I thought SH would do this 2 second thing.

local ply = game.Players.LocalPlayer
local char = ply.Character

Animations = {"LeftSlash", "LeftSwingFast", "Stab1", "Stab2"}

AnimateModel = Instance.new("Model",char)
AnimateModel.Name = "AnimationObjects"
an = Instance.new("Animation", AnimateModel)
an.AnimationId = "http://www.roblox.com/Asset?ID=74894663"
an.Name = "LeftSlash"
an2 = Instance.new("Animation", AnimateModel)
an2.AnimationId = "http://www.roblox.com/Asset?ID=86313418"
an2.Name = "LeftSwingFast"
an3 = Instance.new("Animation", AnimateModel)
an3.AnimationId = "http://www.roblox.com/Asset?ID=96559159"
an3.Name = "Stab1"
an4 = Instance.new("Animation", AnimateModel)
an4.AnimationId = "http://www.roblox.com/Asset?ID=96559161"
an4.Name = "Stab2"
an5 = Instance.new("Animation", AnimateModel)
an5.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
an5.Name = "Equip"

local Damage = 8.5
local SwingTime = 0.5
local LastSwing = tick()
local IsEquipped = false

function GetRandomAnimation()
local r = math.random(1,#Animations)
local rng = Animations[r]
return rng
end

function MouseEvent()
if (tick() - LastSwing) >= SwingTime then
LastSwing = tick()
if IsEquipped == true then
local CurlAnim = GetRandomAnimation()
if CurlAnim ~= nil then
local Anim = char.Humanoid:LoadAnimation(char.AnimationObjects[CurlAnim])
RunningAnim = Anim
Anim:Play(nil,nil,1.2)
coroutine.resume(coroutine.create(function()
wait(0.5)
if RunningAnim == Anim then
Anim = nil
end
end))
end
end
end
end

function Equip(mouse)
IsEquipped = true
LastSwing = tick()
mouse.Button1Down:connect(MouseEvent)
wait(0.02)
local Anim = char.Humanoid:LoadAnimation(char.AnimationObjects.Equip)
RunningAnim = Anim
Anim:Play(nil,nil,1.5)
wait(1.3)
end

function UnEquip()
IsEquipped = false
end

script.Parent.Equipped:connect(Equip)
script.Parent.Unequipped:connect(UnEquip)
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
31 Oct 2014 01:35 PM
Instead of solo mode, launch one server+player client. the results are much more reliable that way.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 01:35 PM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 01:36 PM
Yes but that's not the point, now I need the script fixed..
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 02:09 PM
bump
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
31 Oct 2014 02:13 PM
Sorry to keep asking questions, but what's the output?

Usually it'll say something can't be found if it only works in solo mode.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 02:28 PM
Hmm

20:28:08.107 - Players.Player1.Backpack.Vader's Lightsaber.LocalScript:60: attempt to index upvalue 'char' (a nil value)
20:28:08.108 - Stack Begin
20:28:08.109 - Script 'Players.Player1.Backpack.Vader's Lightsaber.LocalScript', Line 60
20:28:08.110 - Stack End

When I equip it
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 02:29 PM
Line 60:

local Anim = char.Humanoid:LoadAnimation(char.AnimationObjects.Equip)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 02:33 PM
I just ran

if char then
---that line above
end

Then the error didnt come, but then the mouseclick error came about character, it also had an issue with "char" which was my character...Something is up with the character and didnt get fixed with that I ran above.
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
31 Oct 2014 02:42 PM
Try this, not sure if it will work but it'll make the script more reliable anyway:

--
local ply = script.Parent.Parent -- (keep going until you get to player)
local char = ply:WaitForChild("Character")
--

That's all I can think of if that's the output.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 02:44 PM
Okay so, output only gives me erorrs about my character, which is a nil value...What?
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
31 Oct 2014 02:44 PM
Sly, where do I put that, I tried something similiar, where do you suggest to put it?
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