- What do you want to achieve? Keep it simple and clear!
Hello, my objective is to make a Owner join notification. So, basically I have a playeradded event in server script that check if the player UserId Matched with the OwnerUserId if it does it will give everyone in the server bonus coins then a remote event will fire to the localscript and show the Notification Gui otherwise it will print("Owner not found!")
- What is the issue? Include screenshots / videos if possible!
Okay, so I got my alt with me and I’m in the game. When my main account joins which is the Owner of the game my alt suppose to get the bonus coins the same goes to everyone in the server and get notified that I have met a Creator instead my main is the only one that get it.
This is what it suppose to look like when a game creator joins the game.
-- ServerScript
local tween = game:GetService("TweenService")
local Check = game.ReplicatedStorage.Events:WaitForChild("Check")
local PlayCoinsSound = game.ReplicatedStorage.Events:WaitForChild("PlayCoinsSound")
local BonusValue = 10000
local OwnerUserId = 1533601134
game.Players.PlayerAdded:Connect(function(player)
local Folder = Instance.new("Folder")
Folder.Name = "leaderstats"
Folder.Parent = player
local Coins = Instance.new("IntValue")
Coins.Name = "Coins"
Coins.Parent = Folder
if player.UserId == OwnerUserId then
print("Owner has joined the game!")
Coins.Value = BonusValue
PlayCoinsSound:FireAllClients()
print("Coins Successfully Given to Players!")
Check:FireAllClients()
else
print("Owner hasn't join the game yet!")
end
end)
-- LocalScript
local player = game.Players.LocalPlayer
local tween = game:GetService("TweenService")
local Check = game.ReplicatedStorage.Events:WaitForChild("Check")
local PlayCoinsSound = game.ReplicatedStorage.Events:WaitForChild("PlayCoinsSound")
local ReceivedCoinsSound = game.ReplicatedStorage.SoundModule:WaitForChild("ReceivedCoins")
local Frame = script.Parent:WaitForChild("Frame")
local Notifier = script.Parent.Frame:WaitForChild("TextLabel")
local OwnerUserId = 1533601134
local RunTime = 10
local C = Frame.UIGradient.Rotation
local X = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1 ,false, 0.1)
local G = {Rotation = C + 360}
local P = tween:Create(Frame.UIGradient, X, G)
P:Play()
PlayCoinsSound.OnClientEvent:Connect(function()
ReceivedCoinsSound:Play()
end)
Check.OnClientEvent:Connect(function()
print("Double Checking Authentication")
if player.UserId == OwnerUserId then
print("Successful! " .. OwnerUserId)
Notifier.Text = "🎉Congratulations you met a creator and you received a bonus of 10,000 Coins!🎉"
print("Showing Notification")
local H = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local W = {BackgroundTransparency = 0, TextTransparency = 0}
local M = tween:Create(Notifier, H, W)
M:Play()
local T = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0)
local E = {BackgroundTransparency = 0}
local S = tween:Create(Frame, T, E)
S:Play()
task.wait(RunTime)
print("Making Notifier Disappear")
local A = TweenInfo.new(.8, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local O = {BackgroundTransparency = 1, TextTransparency = 1}
local B = tween:Create(Notifier, A, O)
B:Play()
local F = TweenInfo.new(.8, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local L = {BackgroundTransparency = 1}
local J = tween:Create(Frame, F, L)
J:Play()
else
print("Failed to find " .. OwnerUserId)
end
end)
Please help me if you have an answer or a solution to this. Tysm!