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: remote function help

Previous Thread :: Next Thread 
DangerousBloxxer is not online. DangerousBloxxer
Joined: 05 Mar 2011
Total Posts: 421
30 Oct 2017 09:36 PM
function touchedTrigger()
if touched == true then
touched = false
print("trigger activated")
touchedEvent:FireClient()
wait(2)
touched = true
end
end
homeTrigger.Touched:connect(touchedTrigger)

what i tried didnt work

how can i fire the remote event in this function


Report Abuse
DangerousBloxxer is not online. DangerousBloxxer
Joined: 05 Mar 2011
Total Posts: 421
30 Oct 2017 09:43 PM
bump


Report Abuse
WildGuest is not online. WildGuest
Joined: 28 Feb 2010
Total Posts: 647
30 Oct 2017 09:47 PM
Did you define the RemoteEvent?
Add this the very top of the script.


local repStorage = game:GetService("ReplicatedStorage")
local touchedEvent = repStorage:WaitForChild("touchedEvent")




Report Abuse
DangerousBloxxer is not online. DangerousBloxxer
Joined: 05 Mar 2011
Total Posts: 421
30 Oct 2017 10:21 PM
Argument 1 missing or nil

"touchedEvent:FireClient()


on the wiki they connect the event by doing something like this

local function PlayerAdded(player)
touchedEvent:FireClient(player)
end

Players.PlayerAdded:Connect(PlayerAdded)


but now sure how to make this work w/ a touched event

the problem isn't w/ defined variables


Report Abuse
DangerousBloxxer is not online. DangerousBloxxer
Joined: 05 Mar 2011
Total Posts: 421
30 Oct 2017 10:38 PM
plz help

u will be greatness


Report Abuse
WildGuest is not online. WildGuest
Joined: 28 Feb 2010
Total Posts: 647
30 Oct 2017 10:54 PM
Late, but you have to define the player for the server to know which client to fire.

touchedEvent:FireClient(player)


Report Abuse
DangerousBloxxer is not online. DangerousBloxxer
Joined: 05 Mar 2011
Total Posts: 421
30 Oct 2017 11:04 PM
that just gives another error because player isnt really defined


Report Abuse
WildGuest is not online. WildGuest
Joined: 28 Feb 2010
Total Posts: 647
30 Oct 2017 11:09 PM
homeTrigger.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
local player = game.Players:GetPlayerFromCharacter(hit.parent)
if touched == true then
touched = false
print("trigger activated")
touchedEvent:FireClient(player)
wait(2)
touched = true
end
end
end)


Report Abuse
DangerousBloxxer is not online. DangerousBloxxer
Joined: 05 Mar 2011
Total Posts: 421
30 Oct 2017 11:24 PM
that works

appreciate the help


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