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: Why doesnt this work?

Previous Thread :: Next Thread 
romanaisawesome is online. romanaisawesome
Joined: 25 May 2013
Total Posts: 996
31 May 2017 07:14 PM
script 1: Regular Script -- in workspace
------------------------------------------------------------
local Event = game.ReplicatedStorage.PartCount

function fier()
Event:FireClient()
print('Fired')
end
workspace.Parts.ChildAdded:connect(fier)
workspace.Parts.ChildRemoved:connect(fier)

script 2: local Script -- in textlabel in startergui
------------------------------------------------------------
local Event = game.ReplicatedStorage.PartCount

local function Change()
local Amount = workspace.Parts:GetChildren()
script.Parent.Text = "Current Part Cout: "..(#Amount)
end


Change()
Event.OnServerEvent:connect(Event)


Im using a Remote Event; Shoud I change?

Output:
------------------------------------------------------------
17:13:30.473 - Attempt to connect failed: Passed value is not a function
17:13:30.474 - Stack Begin
17:13:30.475 - Script 'Players.Player1.PlayerGui.ScreenGui.PartCount.LocalScript', Line 10
17:13:30.475 - Stack End


This siggy is classified | R$306
Report Abuse
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
31 May 2017 07:41 PM
:connect(Change) at end
Report Abuse
romanaisawesome is online. romanaisawesome
Joined: 25 May 2013
Total Posts: 996
31 May 2017 07:41 PM
where xd


This siggy is classified | R$306
Report Abuse
SuperOmar54 is not online. SuperOmar54
Joined: 12 Aug 2012
Total Posts: 415
31 May 2017 07:44 PM
Event.OnServerEvent:connect(Change)
Report Abuse
helperobc is not online. helperobc
Joined: 04 Sep 2012
Total Posts: 231
31 May 2017 07:45 PM
What he is saying is don't use (Event) but insted (change) to transmit info


so it looks like this:


Event.OnServerEvent:connect(Change)

also consider having change return something back otherwise the script in workspace/serverstorage is useless.



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