so i made a GUI in startergui and gave it a script that would get activated if you press a certain button and it works just fine, but then i made a thing(don't know what it is called) that would activate an event aswell
local A1Fire = game:GetService("ReplicatedStorage"):WaitForChild("Attack1") local Action1 = script.Parent.Frame.Action1 local function onAction1Click() A1Fire:Fire(Action1) print("attack1") end Action1.MouseButton1Click:connect(onAction1Click)
and I also made a script that would get activated and print ouch in output
local A1Fire = game:GetService("ReplicatedStorage"):WaitForChild("Attack1") A1Fire.Event:connect(function() print("ouch1") end)
Can you tell me whats wrong?
You need to do :FireServer or :FireClient or :FireAllClients, and you shouldn't put the events in the ReplicatedStorage. The workspace works fine.
http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent