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
 

FE GUI HELP

Previous Thread :: Next Thread 
Uzil is not online. Uzil
Joined: 02 Jun 2014
Total Posts: 366
18 Jul 2017 03:31 PM
ok, so inside of a ImageButton I have 3 things: remoteEvent, local script for client, and the script for server.

this is inside the Localscript:


remote = script.Parent.Remote
UserInputService = game:GetService("UserInputService")

script.Parent.MouseButton1Click:connect(function()
remote:FireServer()
end)


this is inside the Script:


script.Parent.Remote.OnServerEvent:connect(function(player)
player.Character.Humanoid.Health = 0
end)



I test this in studio and it works, but when I test game mode nothing happens and nothing appears in output.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
18 Jul 2017 03:43 PM
--server script
local re = game.ReplicatedStorage:WaitForChild('RemoteEvent') --store in rep storage

re.OnServerEvent:connect(function(plr)
local human = plr.Character.Humanoid
human.Health = 0
end)

--local script
local re = game.ReplicatedStorage:WaitForChild('RemoteEvent')
local gui = script.Parent

gui.MouseButton1Click:connect(function()
re:FireServer()
end)


Report Abuse
Uzil is not online. Uzil
Joined: 02 Jun 2014
Total Posts: 366
19 Jul 2017 11:45 AM
For some reason it still doesn't work
Report Abuse
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
19 Jul 2017 12:01 PM
Put your event into ReplicatedStorage, your server script in ServerScriptStorage, and other in StarterGui.

Report Abuse
Uzil is not online. Uzil
Joined: 02 Jun 2014
Total Posts: 366
19 Jul 2017 12:21 PM
@luka&timeticks, it works, thanks for the help brodies 😎
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