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: Problem

Previous Thread :: Next Thread 
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 04:31 PM
So, my script works in studio when I "Play Solo", but it won't work on the actual game itself. Anyone know how to fix?

Script:

local module = {}
local storage = game.ServerStorage
local resources = storage.Resources

local function weldBetween(a, b)
local weld = Instance.new("ManualWeld", a)
weld.Part0 = a
################################################################################################################################################## if resources.Morphs[morph] then
local body = resources.Morphs[morph]:Clone()
body.Parent = character
for _, model in pairs(body:GetChildren()) do
for _, part in pairs(model:GetChildren()) do
weldBetween(part, model.Middle)
print('suspended '..part.Name..' from '..model.Name)
end
print('completed '..model.Name)
weldBetween(model.Middle, character[model.Name])
end

for _, piece in pairs(character:GetChildren()) do
if piece:IsA('Hat') then
piece:Destroy()
end
end

print('finished morph')

return body
end
end

module.forceRespawn = function(player)
player:LoadCharacter()
end

return module


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 04:32 PM
weld.Part1 = b
weld.C0 = a.CFrame:inverse() * b.CFrame
a.Anchored = false
end

module.createMorph = function(morph, character)



Hashed part ^^^


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 04:36 PM
I do not have time to examine your script, nor the effort

But I can say the common causes of this to happen:

-FilteringEnabled
-PUT IT IN A LOCALSCRIPT111!!!
-Yeah that's really all

Please do some prints and get some more specific information.


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 04:46 PM
Tried 3 options using what you just said, didn't work.


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 04:47 PM
Do a print after each line to check if it yields

Then tell me where it yields


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 04:48 PM
Maybe change to

function module:forceRespawn()
player:LoadCharacter()
end

I'm not great for examining people's syntax like this


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 04:55 PM
Alright so, I did both. doesn't work, but I think I know which script is causing the trouble.

I have a button to press, which will then run the script that I already showed you.

script in button:

script.Parent.MouseButton1Click:connect(onClicked)

wait(2)
function onClicked()
local repstorage = game.ReplicatedStorage
local modules = {
morph = require(repstorage:WaitForChild('MorphModule'));
}
wait(2)
modules.morph.createMorph('Warrior', game.Players.LocalPlayer.Character)

modules.morph.respawnPlayer(game.Players.LocalPlayer)
end
script.Parent.MouseButton1Click:connect(onClicked)


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 04:57 PM
function onClicked()
local repstorage = game.ReplicatedStorage
local modules = {
morph = require(repstorage:WaitForChild('MorphModule'));
}
wait(2)
modules.morph.createMorph('Warrior', game.Players.LocalPlayer.Character)

modules.morph.respawnPlayer(game.Players.LocalPlayer)
end


will not run


also u probably have one but i don't see an end which closes the first scope


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 04:59 PM
Just elaborating a bit more

'function onClicked()
local repstorage = game.ReplicatedStorage
local modules = {
morph = require(repstorage:WaitForChild('MorphModule'));
}
wait(2)
modules.morph.createMorph('Warrior', game.Players.LocalPlayer.Character)

modules.morph.respawnPlayer(game.Players.LocalPlayer)
end'

This will not run because the event trigger has finished or that the user isn't clicking twice in like 0.0000001 miliseconds lol.


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 04:59 PM
Why won't it run?
do you kno?


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:00 PM
I just explained

the trigger is dead


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:00 PM
All you have to do is remove that scope and it will all run correctly


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 05:01 PM
Soz, didn't see the other post.

Do you know how to fix it?


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 05:02 PM
The scope you're talking about is what you copy pasted?


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:02 PM
Yeah

And of course the trigger


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 05:03 PM
Wouldn't that just leave me with the starting function?


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:06 PM
script.Parent.MouseButton1Click:connect(onClicked)

wait(2)
local repstorage = game.ReplicatedStorage
local modules = {
morph = require(repstorage:WaitForChild('MorphModule'));
}
wait(2)
modules.morph.createMorph('Warrior', game.Players.LocalPlayer.Character)
modules.morph.respawnPlayer(game.Players.LocalPlayer)
end

if it's still not working do some prints when you're using the module becausee modules can cause wait times and crap


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:07 PM
idk well roblox just removed my huge explanation and solution and advice about the module so rip i might post something up quick


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:08 PM
yeah just use what i said before it's fine lol sorry about that it's the flood check


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 05:09 PM
Something's wrong with the "end"


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:09 PM
wait ill put it into an ide brb


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:10 PM
Yeah I'm not great with syntax. Here it is tho

script.Parent.MouseButton1Click:connect(function()

wait(2)
local repstorage = game.ReplicatedStorage
local modules = {
morph = require(repstorage:WaitForChild('MorphModule'));
}
wait(2)
modules.morph.createMorph('Warrior', game.Players.LocalPlayer.Character)
modules.morph.respawnPlayer(game.Players.LocalPlayer)
end)


Report Abuse
ChadZer is not online. ChadZer
Joined: 14 Dec 2010
Total Posts: 653
10 Sep 2016 05:15 PM
prnt.sc/cgjm4z

Works in the "Play Solo"
Not int he actual game


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:16 PM
don't use a table for modules and be careful what u put in server and local


done

im tired bro


Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 05:18 PM
local ErrorChecker = game:WaitForChild("ServerStorage", 5)

if ErrorChecker = nil (or whatever it outputs when fail) then
error("Something is seriously messed up.")
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