i think this is the stupidest post i made so far since i find this really easy but i just cant i need help with this
more details:the clickdetector is parented to the handle of a tool (i have everything scripted except the notification as i find it impossible to connect two scripts that do almost the same)
Hi there, after you click on clickdetector you just need to have remoteevent which will fire to all clients, something like this:
local ClickDetector = game.Workspace.Part.ClickDetector
local RS = game:GetService("ReplicatedStorage")
local Event = RS.RemoteEvent
ClickDetector.MouseClick:Connect(function()
Event:FireAllClients()
end)
and then in local script you can do something like this:
local RS = game:GetService("ReplicatedStorage")
local Remote = RS.RemoteEvent
local plrgui = game.Players.LocalPlayer.PlayerGui
Remote.OnClientEvent:Connect(function()
plrgui.GUI.TextLabel.Visible = true
end)
hope that helps
i meant the built in notification game.StarterGui:SetCore(“SendNotification”) but i’ll try to modify this
fixed it, i mean you helped since i dont know how to use remote events soo
local script in StarterPlayerScripts
:
local RS = game:GetService("ReplicatedStorage")
local Remote = RS.RemoteEvent
Remote.OnClientEvent:Connect(function()
game.StarterGui:SetCore("SendNotification",{
Title = "you got new item";
Text = "you got that new item in your backpack";
Duration = 2.5
})
end)
normal script in ServerScriptService
:
local ClickDetector = game.Workspace.m.Handle.ClickDetector
local RS = game:GetService("ReplicatedStorage")
local Event = RS.RemoteEvent
ClickDetector.MouseClick:Connect(function()
Event:FireAllClients()
end)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.