local sound = Instance.new("Sound", game.Workspace)
sound.SoundId = "rbxassetid://3625290171"
local player = game:GetService("Players").LocalPlayer
local ShowMessage = player.Backpack:WaitForChild("ShowMessage")
function dmt()
ShowMessage:Fire("Complimenti! Hai superato la fase " .. player.leaderstats.PhereStage.Value .. "!", true)
sound:Play()
end
workspace.StartPhere['1'].Touched:Connect(dmt)
I have 1278312 problems today. Why when i touch the "1" Model, the function not start? 0 errors in console.
ShowMessage Localscript:
local player = game:GetService("Players").LocalPlayer
local ShowMessage = player.Backpack:WaitForChild("ShowMessage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local messageFadeStyle = TweenInfo.new(2,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
local messageFadeStyle2 = TweenInfo.new(5,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
local messageTarget = {TextTransparency = 1, Position = UDim2.new(0,0,0.2,0)}
local messageTarget2 = {TextTransparency = 1, Position = UDim2.new(0,0,-1,0)}
local ServerFeedback = ReplicatedStorage:WaitForChild("ServerFeedback")
local MessageTemplate = script.Parent.Message
COLORS = {
[true] = Color3.fromRGB(0,255,0),
[false] = Color3.fromRGB(255,0,0)
}
local debounce = false
local function OnShowMessage(message,result)
if not debounce then
debounce = true
local newMessage = MessageTemplate:Clone()
newMessage.Text = message
newMessage.TextStrokeColor3 = COLORS[result]
newMessage.Visible = true
newMessage.Parent = MessageTemplate.Parent
local tween = TweenService:Create(newMessage,messageFadeStyle,messageTarget)
tween:Play()
wait(0.5)
debounce = false
tween.Completed:Wait()
local tween2 = TweenService:Create(newMessage,messageFadeStyle2,messageTarget2)
tween2:Play()
wait(1)
newMessage:Destroy()
end
end
ServerFeedback.OnClientEvent:Connect(OnShowMessage)
ShowMessage.Event:Connect(OnShowMessage)
Today i'm completely melted, i do 67123283187 errors. i need go to sleep.
