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: the script doesnt work on a server

Previous Thread :: Next Thread 
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
10 Nov 2014 01:36 AM
this script doesnt work on a server but works fine when i play solo
(this script is inside a part)
script.Parent.Touched:connect(function(part)
local h = part.Parent:FindFirstchild("Humanoid")
if h ~= nil then
print ("touched")
end
end)

there are no error messages D:

it just doesnt work.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
10 Nov 2014 01:39 AM
do you have output open online
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
10 Nov 2014 01:59 AM
yep
Report Abuse
Ben1925 is not online. Ben1925
Joined: 07 Apr 2011
Total Posts: 741
10 Nov 2014 05:19 AM
Put print functions for every line. when the functions stop that must be where it is.
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
10 Nov 2014 09:26 AM
ive done everything i could.but it still doesnt work...
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
10 Nov 2014 02:22 PM
Are using the local output or sever
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
10 Nov 2014 08:43 PM
it doesn't say anything besides "output" so i don't really know...
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
12 Nov 2014 03:54 AM
since the studio updated,i have been having this issue.
Report Abuse
GOLDC3PO is not online. GOLDC3PO
Joined: 31 May 2011
Total Posts: 509
12 Nov 2014 06:19 AM
script.Parent.Touched:connect(function(part)
local h = part.Parent["Humanoid"]
if h ~= nil then
print ("touched")
end
end)
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
12 Nov 2014 07:49 AM
still doesnt work...
Report Abuse
ShadowOfCrimson is not online. ShadowOfCrimson
Joined: 14 Dec 2009
Total Posts: 2153
12 Nov 2014 08:17 AM
script.Parent.Touched:connect(function(part)
local h = part.Parent:FindFirstChild("Humanoid")
if h ~= nil then
print ("touched")
end
end)

--you didn't capitalize Child, i doubt that would cause an issue, but maybe?
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
13 Nov 2014 12:30 AM
script.Parent.Touched:connect(function(part)
local h = part.Parent:FindFirstChild("Humanoid")
if h ~= nil then
print ("touched")
end
end)


works fine when i play solo but doesnt work on a server...
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
13 Nov 2014 12:36 AM
just do

debounce = false
script.Parent.Touched:connect(function(part)
if part.Parent:FindFirstChild("Humanoid") ~= nil and not debounce then --you could get rid of ~= nil but it's kind of weird that Lua allows that and doesn't make sense for anyone who uses other languages.
debounce = true
print("touched")
debounce = false
end
end)

Now are you ever looking for your output? Try something instead of printing "touched" and I bet it'll work. I also added a debounce to avoid the function repeating unreasonably (because that's how ROBLOX's Touched event works)
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
14 Nov 2014 12:52 AM
thanks for trying to help me,but it still doesn't work T_T
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
14 Nov 2014 12:54 AM
@Op
You are either lying or looking at the local output

I just tried the script it does work
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
14 Nov 2014 01:49 AM
i'm not lying,it really doesn't work


how do you know if its a local output btw
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
14 Nov 2014 01:50 AM
the roblox default online output by default opens the local output
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
14 Nov 2014 01:56 AM
https://www.youtube.com/watch?v=of7wEsq26lw
Report Abuse
FearlessCrossFire is not online. FearlessCrossFire
Joined: 07 Feb 2012
Total Posts: 138
14 Nov 2014 02:06 AM
Whoa,works...thanks for helping me :D

works now :D
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